Why will my script not work correctly?
I follow a YouTube video and worked for the guy.
I am running Perl on Windows using ActiveState ActivePerl 5.12.2.1202
Here is my tiny tiny code block.
print "What is your name?
";
$name = <STDIN>;
if ($name eq "Jon") {
print "We have met before!
";
} else {
print "We have not met before.
";
}
The code automatically jumps to the else statement and does not even check the if statement.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…