in reply to printing hash of array
Here's the final piece that you needed, which was to dereference the hash info using the value of the key $code:
use strict; use warnings; + my $info = { 'last' => [ 'jones', 'smith', 'long' ] }; + + foreach my $code ( keys %{$info} ) { print $code . ":"; foreach my $last ( @{$info->{$code}} ) { print " " . $last; } print "\n"; }
|
|---|