in reply to Perl Array of Hashes
Is it necessary to create "BUCK_1", "BUCK_2", etc? That seems like an array.
Does "BUCK" ever become something else? What if the datastructure looked more like this:
$xentry[0] = { BUCK => [ qw/JUNK JUNK JUNK JUNK/ ], TUBS => [ qw/THUMP THUMP THUMP THUMP/ ] };
Then instead of $xentry[0]->{BUCK_1} it would be $xentry[0]->{BUCK}[1], for example. I believe that not trying to create in-fix indexes in a hash key, and instead, letting arrays do your work will prove to be less headaches in the longrun.
Dave
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Perl Array of Hashes
by abhay180 (Sexton) on Jul 27, 2009 at 06:02 UTC |