in reply to Doubt on defined-ness
So why is the first idiom "suboptimal"?
I haven't looked up that passage in the Camel Book, so I'm not sure
what it's referring to... but maybe it's trying to point out that 'if ($_=<FH>) ...' could
evaluate to false in circumstances where you don't want it to be false (the line being empty or zero). Just a guess though.
(Update: crossed out "empty", because - upon rethinking - I can't really come up with any case where $_ would be the emtpy string — not even when fiddling with the input record separator...)
Update 2: ikegami actually did find a variant where <> can return an empty string... So, I might in theory un-strike that part again. But I won't — I guess it's unlikely anyone will run into this case by accident :)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Doubt on defined-ness
by ikegami (Patriarch) on Jun 18, 2008 at 23:48 UTC | |
|
Re^2: Doubt on defined-ness
by ikegami (Patriarch) on Jun 18, 2008 at 22:48 UTC | |
by almut (Canon) on Jun 18, 2008 at 23:31 UTC | |
by ikegami (Patriarch) on Jun 18, 2008 at 23:42 UTC | |
by almut (Canon) on Jun 18, 2008 at 23:51 UTC | |
|
Re^2: Doubt on defined-ness
by bart (Canon) on Jun 19, 2008 at 12:19 UTC |