in reply to How i can create hash of arrays of hashes from my 3 arrays?
#$hash{$array1[$_]}{$array2[$_]} = $array3[$_] for (0..$#array1); push @{$hash{$array1[$_]}{$array2[$_]}}, $array3[$_] for (0..$#array1 +);
UPDATE: Create hash-of-hash-of-arrays as hinted in OP code. This still does not agree with the title of the thread. Add output of updated code.
OUTPUT: $VAR1 = { '400000008' => { 'Network1' => [ '2021-01-25T17:19:36.000Z' ] }, '500000008' => { 'Network2' => [ 'Not Used' ], 'Network1' => [ '2021-03-10T17:11:24.000Z', '2021-03-11T17:12:42.000Z' ], 'Network3' => [ 'Not Used' ] }, '900000001' => { 'Network1' => [ 'Login' ] }, '900000003' => { 'No Network1' => [ ' NOT Registered' ] }, '900000005' => { 'Network1' => [ 'Login' ] }, '900000007' => { 'Network1' => [ '2021-03-10T17:11:24.000Z', '2021-02-18T08:34:58.000Z', '2021-01-25T17:19:44.000Z' ] }, '900000002' => { 'Network1' => [ '2019-11-07T20:31:10.000Z', '2021-02-19T13:47:25.000Z', '2021-03-10T13:58:50.000Z' ] }, '900000004' => { 'Network1' => [ 'Login' ] }, '900000006' => { 'Network1' => [ 'Login2' ] } };
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: How i can create hash of arrays of hashes from my 3 arrays?
by chandantul (Scribe) on Mar 13, 2021 at 21:35 UTC | |
by BillKSmith (Monsignor) on Mar 14, 2021 at 23:47 UTC | |
by chandantul (Scribe) on Mar 15, 2021 at 01:23 UTC | |
by BillKSmith (Monsignor) on Mar 16, 2021 at 13:51 UTC | |
by AnomalousMonk (Archbishop) on Mar 15, 2021 at 02:21 UTC | |
by chandantul (Scribe) on Mar 15, 2021 at 14:24 UTC |