Hi all, probably a dumb question, but I am using <STDIN> to collect user information on a Perl script on Mac OSX. For some reason pressing Enter moves the cursor to the next line, and only by pressing control-D can I get it to continue. And control-D by itself doesn't do it either. Naturally I'd like the Enter key to be the only thing needed. Am I doing something wrong?
#!/usr/bin/perl print "How many cookies do you want? Enter number: "; my($cookies) = <STDIN>; chomp($cookies); print "You wanted only $cookies?\n";
Thanks -
In reply to STDIN Enter key not quite working by slugger415
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |