in reply to error creating hash of array
When you just do this:
Perl autovivifies a hash element with $type as the key whenever there is a new value in $type, and creates a ref to a new array as its value; it then pushes the string $key onto the array.my %HoA; foreach my $key (keys %$ref_to_HoH){ my $type = $$ref_to_HoH{$key}{TABLE_TYPE}; push @{$HoA{$type}},$key; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: error creating hash of array
by HarshaHegde (Sexton) on Nov 04, 2007 at 18:23 UTC |