|
|
| No such thing as a small change | |
| PerlMonks |
Re^3: Homework helpby ikegami (Patriarch) |
| on Oct 30, 2004 at 13:55 UTC ( [id://404045]=note: print w/replies, xml ) | Need Help?? |
This is an archived low-energy page for bots and other anonmyous visitors. Please sign up if you are a human and want to interact.
I would have predicted that the last unless defined would not work right on empty input b/c $_ still contains a "\n"It doesn't work on empty input. It works on eof/error. It's there to prevent the next two lines from giving "undefined value" warnings under use warnings. The last unless length that follows is what detects the empty string (since chomp removed the "\n" by then).
In Section
Seekers of Perl Wisdom
|
|
||||||||||||||||||||||||