On 26/11/2011 21:55, Brandon McCaig wrote:
I just skimmed perlop again and it doesn't seem to explicitly say that&& and || and other related operators return the last evaluated operand instead of a boolean (the latter being what C and many other "static" languages do). I guess it's just something that you need to know from experience (many other languages with similar features to Perl also work this way).
perlop (In the second paragraph at <http://perldoc.perl.org/perlop.html#C-style-Logical-Defined-Or>) reads:
The "||", "//" and "&&" operators return the last value evaluated (unlike C's "||" and "&&", which return 0 or 1).
Rob -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/