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'.
In reply to slicing a hash ref by rvosa
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |