in reply to array of hashes question
use 'Data::Dumper' module to print your data structure @a, you can visualize what you have created.foreach my $hash (@a){ foreach my $key (keys %{$hash}){ print "key >$key< value>",$hash->{$key},"<\n"; } }
use strict; use warnings; use diagnostics;
you are using @a for merging, but finally expecting output in @octopus_plid, how it is possible?.$a[$j]{$key} and $a[$j]->{$key} both will work
for my $key (keys %{$a[0]}) according to your above presented logic
before calling the second for loop just try use Data::Dumper; print Dumper \@a;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: array of hashes question
by jimmy78 (Initiate) on Feb 18, 2009 at 17:11 UTC | |
|
Re^2: array of hashes question
by Anonymous Monk on Feb 18, 2009 at 19:30 UTC | |
|
Re^2: array of hashes question
by jimmy78 (Initiate) on Feb 18, 2009 at 16:37 UTC | |
|
Re^2: array of hashes question
by jimmy78 (Initiate) on Feb 18, 2009 at 16:54 UTC | |
|
Re^2: array of hashes question
by jimmy78 (Initiate) on Feb 18, 2009 at 17:06 UTC |