in reply to Re^2: Hash w/ multiple values + merging
in thread Hash w/ multiple values + merging
Since the reference type in this case is of an ARRAY something like "@$hash{ATA}}" would show you the values associated with "ATA", to access them one at a time you can specify indices like you do any regular arrays; $hash{ATA}[0] would print the first element of the anonymous array associated to the key "ATA"..
The module Data::Dumper would show you the data structures stringified so that you could judge if they look like you expected them before proceeding any further...
#ADD this to the previous code... use Data::Dumper; print Data::Dumper->Dump([\%hash1],['FIRST HASH']),"\n"; print Data::Dumper->Dump([\%hash2],['SECOND HASH']),"\n"; print Data::Dumper->Dump([\%hash3],['MERGED HASH']),"\n";
Note also that there can be more than one way to do it which would become clearer when you start dealing with more complex data structures..
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Hash w/ multiple values + merging
by sophix (Sexton) on Feb 07, 2010 at 23:04 UTC | |
by Anonymous Monk on Feb 07, 2010 at 23:11 UTC |