in reply to array of hash
I build a hash and then, I create an array of this hash...
push @currArr,%currHash;
As choroba pointed out you are not building an array of hashes here. An array of hashes is actually an array of hash references. The Perl Data Structures Cookbook shows a few different ways to create arrays of hashes. However, from your example code it isn't obvious that an array of hashes is what you need.
$curr{"my"}->[2]{"AB"}++;
This looks like you're trying to use a hash of arrays of hashes. Can you describe the data structure you need or the problem you are trying to solve? Maybe check out some tutorials for perl data structures.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: array of hash
by carolw (Sexton) on May 28, 2014 at 08:47 UTC |