in reply to Initialize multiple variables in one statement
More of a gee-whiz than anything else, but at least the following allows lexicals to be added and removed without worrying about adjusting any initializer list or repetition count:
c:\@Work\Perl\monks>perl -wMstrict -le "$_ = 'phil' for my ($name1, $name2, $name3, $name4); print qq{'$name1' '$name2' '$name3' '$name4'}; ;; my $init = 42; $_ = $init++ for my ($n1, $n2, $n3); print qq{$n1, $n2, $n3}; " 'phil' 'phil' 'phil' 'phil' 42, 43, 44
Give a man a fish: <%-{-{-{-<
|
|---|