Just got the Llama book, and learning perl!!!
Got a quick question though....
Here's the script:
chomp ($var = <STDIN>);
if (defined($var)) {
print "Input was $var\n";
} else {
print "no input\n";
At user input, if I just hit Enter, doesn't that just create a newline? Shouldn't the chomp command make the $var = undef then?
If I do that though, I just get "Input was "
Might be a simple question, but I thought that chomp always got rid of the first newline. ________________________________________
Check out
Got a quick question though....
Here's the script:
chomp ($var = <STDIN>);
if (defined($var)) {
print "Input was $var\n";
} else {
print "no input\n";
At user input, if I just hit Enter, doesn't that just create a newline? Shouldn't the chomp command make the $var = undef then?
If I do that though, I just get "Input was "
Might be a simple question, but I thought that chomp always got rid of the first newline. ________________________________________
Check out