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.
In reply to Re: How do I use hashref slices?
by Ovid
in thread How do I use hashref slices?
by kingman
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |