Hi,
I'm just starting to learn Perl and I'm a bit confused. I have a program like this:
print "Enter your name!\n";
$name = <STDIN>;
print "Hello $name!\n";
The problem is that when I run it, it sits there waiting for input, after which it will display the "Enter your name" and "Hello" lines. Why is it trying to get input before it has even executed the first line?
Thanks for any help.
I'm just starting to learn Perl and I'm a bit confused. I have a program like this:
print "Enter your name!\n";
$name = <STDIN>;
print "Hello $name!\n";
The problem is that when I run it, it sits there waiting for input, after which it will display the "Enter your name" and "Hello" lines. Why is it trying to get input before it has even executed the first line?
Thanks for any help.