http://qs321.pair.com?node_id=11138235


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