neversaint has asked for the wisdom of the Perl Monks concerning the following question:
How can I generate/initialize a Hash of Hash of Array like this with Map:my @array = qw (foo bar qux);
I can do it with double foreach but since in the actual situation the array is very large (ten thousand elements ore more) and I need it to be super fast. I suppose 'map' is the answer?my $VAR1 = { 'foo' => { 'foo' => [], 'bar' => [], 'qux' => [] }, 'bar' => { 'foo' => [], 'bar' => [], 'qux' => [] }, 'qux' => { 'foo' => [], 'bar' => [], 'qux' => [] }, };
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Initializing HoHoA with Map
by BrowserUk (Patriarch) on Aug 01, 2006 at 08:36 UTC | |
|
Re: Initializing HoHoA with Map
by Sidhekin (Priest) on Aug 01, 2006 at 08:11 UTC |