P is for Practical | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
I wrote to Larry about this sort of thing once:
me: The following is from page 75 in the Camel: "List assignment in scalar context returns the number of elements produced by the expression on the right side of the assignment: $x = ( ($a, $b) = (7,7,7) ); #set $x to 3, not 2 why. how. Larry on why: Because then you can use it for a boolean value: while (($a,$b) = somefunc()) { ... } If it used the number of elements on the left, it would always be true. Larry on how: It counts them. :-) In reply to Re: what's this loo code?
by clairudjinn
|
|