Hi,
I am a perl novice, and am embarking on creating a perl script for work. The following test loop does not break when I input nothing and then press 'return', it just keeps looping. Something wrong? I can't see an issue:
print "Hello How are you?\n"; print "Please enter your reply here: "; $count=0; while (defined(chomp(@input[$count]=<STDIN>))) { print "\nYour entry was \"@input[$count]\""; $count++; }
Any help greatly appreciated!
Npatel
20090323 Janitored by Corion: Added formatting, code tags, as per Writeup Formatting Tips
In reply to While(defined(STDIN)) does not break by npatel
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |