good chemistry is complicated, and a little bit messy -LW |
|
PerlMonks |
Re: True or False? A Quick Reference Guideby Zaxo (Archbishop) |
on Sep 29, 2005 at 05:32 UTC ( [id://495986]=note: print w/replies, xml ) | Need Help?? |
bobf++, well done. There is another logical operator; I like to regard the sequence operator, scalar comma, as the unconditional logical operator. The right hand argument is evaluated regardless of the truth of the already-evaluated left, and the last evaluated value is returned. Naturally, this has more use in shoehorning several evaluations into a single expression than in pure logic. It's often useful that way in the body of modifier statements like s/foo/bar/g, print for <>;. Used where logicals are often seen, sequence expressions can be a sort of front-loaded continue block - without introducing a scope. Note that increment and value of a variable in one expression are ok with C if they are seperated by the comma operator. That seems to work in Perl, too, as is sort-of-documented. I think that that view of the sequence operator is not the usual one, but I find it useful. If there were an ultra-low precedence version like and and or, I'd call it then. After Compline,
In Section
Meditations
|
|