in reply to Iterating over hash to find specific key to sum up the cost
your indentation is misleading, the cost entries are at different levels.
I was thinking of chaining 3 maps but thats not possible here.
I recommend using Data::Diver or Data::Leaf::Walker or the alternative recursive solutions listed in threads mentioning these modules.
my $VAR1 = { '153-1' => { '19-4' => { 'cost' => '6300.00', 'cost2' => '630.00' }, '135-1' => { '68-4' => { 'cost' => '300.00', 'cost2' => '130.00' } }, '1069-9' => {}, '35-1' => { '28-4' => { 'cost' => '30.00', 'cost2' => '10.00' } }, }, };
Cheers Rolf
(addicted to the Perl Programming Language :)
Wikisyntax for the Monastery
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Iterating over hash to find specific key to sum up the cost (updated)
by haukex (Archbishop) on Oct 29, 2021 at 19:33 UTC | |
by LanX (Saint) on Oct 29, 2021 at 19:56 UTC | |
by haukex (Archbishop) on Oct 29, 2021 at 20:03 UTC | |
by LanX (Saint) on Oct 29, 2021 at 20:09 UTC |
In Section
Seekers of Perl Wisdom