rvosa has asked for the wisdom of the Perl Monks concerning the following question:
Now I want to do the same with a hash reference:%hash = ( 'a' => 1, 'b' => 2 ); print @hash{'a','b'}; # prints '12'
Thanks!$hasref = { 'a' => 1, 'b' => 2 }; # not sure... is it $hashref->{'a','b'}? That just yields 'uninitializ +ed'.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: slicing a hash ref
by Sidhekin (Priest) on Jul 01, 2006 at 02:59 UTC | |
|
Re: slicing a hash ref (quick)
by tye (Sage) on Jul 01, 2006 at 04:10 UTC |