in reply to Looping through hash of hashes
use strict; use warnings; my $p; my %file_attachments = ( '1' => { 'price' => '10.00', 'desc' => 'the 1st test'}, '2' => { 'price' => '12.00', 'desc' => 'the 2nd test'}, '3' => { 'price' => '13.00', 'desc' => 'the 3rd test'}, '4' => { '' => '', '35' => 'D', '11' => '3104052', '63' => '0', '167' => 'FUT', '200' => '200512', '1' => '2', '44' => '112.55', '55' => 'XEURFGBM0F2005Z', '50' => 'portwaretrader1', '40' => '2', '57' => 'RISKGATEWAY', '15' => 'USD', '38' => '1', '52' => '20051118-07:31:46', '59' => '0', '60' => '20051118-07:31:40', '34' => '37', '56' => 'EXLINK_CAMPBELL', '49' => 'CAMPBELL_EXLINK', '10' => '170', '54' => '1' } ); for (sort keys %file_attachments) { print "'$_' =>\n"; $p = $file_attachments{$_}; print " '$_' => '$p->{$_}'\n" for sort keys %$p; print "\n"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Looping through hash of hashes
by minixman (Beadle) on Nov 26, 2005 at 16:55 UTC |