for (1..10) { $first ||= $last = $_; } print "$first..$last\n";
I was doing something like this in a one liner (to extract the first and last lines of a file). It made me scratch my head.
Is this a feature? (this is the meditation part of the posting :).
Update: I know why it does it, I'm just curious to see if anyone else is surprised by it or gets it wrong first time.
In reply to what does this print? by fergal
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |