You could do that cheaper using TypeGlobs (Just showing off recently-acquired knowledge).%item = %{$array[0]}; # Creates a copy of the hash print $item{key};
Details in perldoc perldata, under "Typeglobs and Filehandles".no strict "vars"; # Allow local decs local *item = \%{$array[0]}; # Creates a ref. No copy. print $item{key};
In reply to Re: Reference to a hash in an array of hashes
by NetWallah
in thread Reference to a hash in an array of hashes
by vlad
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |