Perl: the Markov chain saw | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
In answering a question on the Perl Beginner's list, I stumbled across the following:
No, it's not an array slice. The "0,1,2" is a list and each element of the list is evaluated from left to right and the results of the last evaluation (2) are returned. Thus, the above snippet prints "bird", but issues no warnings. However, if I change the 1 to a 2:
I get the following:
chromatic guessed that this may be a hack in Perl to allow us to put 1 at the bottom of modules without a warning, but I'm not sure. Is this documented anywhere, or is it a bug? Cheers, Join the Perlmonks Setiathome Group or just click on the the link and check out our stats. In reply to Sometimes it's in Void Context by Ovid
|
|