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 reply to Re^3: Homework help
by ikegami
in thread Homework help
by gitarwmn
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |