in reply to Question about dereferencing multi-dimensional array/hash
my ($first_key, $first_val) = each(%{$main_hash{$k}[$x]};
One other thing that stands out to me... The following line lets the loop go one iteration too many. You should use $x instead of $x + 1:
Try changing these and let me know if anything changes.last if ($x + 1 >= scalar(@{$main_hash{$k}});
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Question about dereferencing multi-dimensional array/hash
by jokerzy (Initiate) on Jun 18, 2012 at 05:36 UTC |