Ok, it's not a huge issue and has an easy workaround, but I'm curious as to why this does not work. I want to break out of the while loop if an empty string is entered to STDIN. Am I missing something obvious due to sleep deprivation or lack of caffeine?
print " > "; while (chomp( my $line = <STDIN>)){ print " [$line]\n"; } print " > ";
I'm not looking for a solution, I already have that. Just wondering why this doesn't work
In reply to Empty STDIN does not exit while loop by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |