Next | Welcome to my ~/bin | 4 |
First, does everyone know about this?
@numbers = (1..4); for (@numbers) { $_ *= 2; } print "@numbers\n"; # prints 2 4 6 8
How about this?
($a, $b, $c, $d) = (1..4); for ($a, $b, $c, $d) { $_ *= 2; } print "$a $b $c $d\n"; # prints 2 4 6 8
continued...
Next | Menu | Copyright © 2005 M. J. Dominus |