Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
How do I print the contents of the array?$VAR1 = { 'last' => [ 'jones', 'smith', 'long' ] };
I tried the following:
I think I'm close...and $info is a scalar so I'm assuming I have to use %{$info}foreach my $code ( keys %{$info} ) { print $code . ":"; foreach my $last ( @{$code} ) { print " " . $last; } print "\n"; }
Thanks
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: printing hash of array
by xdg (Monsignor) on Dec 06, 2006 at 02:59 UTC | |
by Anonymous Monk on Dec 06, 2006 at 03:06 UTC | |
|
Re: printing hash of array
by wjw (Priest) on Dec 06, 2006 at 03:31 UTC | |
|
Re: printing hash of array
by liverpole (Monsignor) on Dec 06, 2006 at 15:09 UTC |