Problems? Is your data what you think it is? | |
PerlMonks |
Re: Empty STDIN does not exit while loopby choroba (Cardinal) |
on May 20, 2017 at 07:59 UTC ( [id://1190702]=note: print w/replies, xml ) | Need Help?? |
chomp returns the number of characters removed. If you entered the "empty string" by pressing <Enter> , then chomp removes the newline and returns 1. Using chomp in a while condition is usually not what you want. It'd skip the last line of a file if it didn't end in a newline.
In Section
Seekers of Perl Wisdom
|
|