in reply to Set::Scalar saves you from hash acrobatics
Another word on the syntax: it's slightly wrong :-)
my %hash; @hash{qw(foo bar baz)} = 1 x 3; print "$_ => $hash{$_}\n" for keys %hash;
There should be parentheses around the '1':
@hash{qw(foo bar baz)} = (1) x 3;dave
Update: Oops, Ovid beat me to it by a couple of minutes!
|
|---|