hello_beginner has asked for the wisdom of the Perl Monks concerning the following question:
I am trying to print the hash values, but i am not getting the actual result instead array reference
$VAR1 = { 'A1' => { 'val1' => [23], 'val2' => [42], 'val3' => [15], 'val4' => [10] } B1' => { 'val1' => [13], 'val2' => [22], 'val3' => [25], 'val4' => [11] };
my %data; foreach my $key (sort keys %data) { foreach my $elem (keys %{$hash{$key} { print"$key : $hash{$key}->{$val}"; } }
but instead of actual values, its print ARRAY(00X)reference
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: print hash elements
by AnomalousMonk (Archbishop) on Sep 12, 2016 at 19:43 UTC | |
|
Re: print hash elements
by GotToBTru (Prior) on Sep 12, 2016 at 18:45 UTC | |
|
Re^2: print hash elements
by perl-diddler (Chaplain) on Sep 13, 2016 at 13:16 UTC | |
by stevieb (Canon) on Sep 13, 2016 at 14:19 UTC |