Welcome to the Monastery | |
PerlMonks |
Re^2: ARGV questionby olus (Curate) |
on Aug 18, 2008 at 22:13 UTC ( [id://705085]=note: print w/replies, xml ) | Need Help?? |
I got curious about that behavior of the zero length result, went looking and now humbly share my findings. In chapter 3 of Programming Perl it is said that The equal and not-equal operators return 1 for true and "" for false (3.12) and The && and || operators differ from C's in that, rather than returning 0 or 1, they return the last value evaluated. (3.14) so, @ARGV is greater than 0 and passes, eq fails and returns '', and thus && returns the last value evaluated, which is ''.
In Section
Seekers of Perl Wisdom
|
|