in reply to How do I use hashref slices?
The syntax is clumsy:
my $hashref = { one => 1, two => 2, three => 3 }; print @{$hashref}{qw/two three/};
For your code:
@{$t}{qw/first second third/} = qw(one two three);
Cheers,
Ovid
Join the Perlmonks Setiathome Group or just click on the the link and check out our stats.
|
|---|