in reply to sorting hash of hashes
Is this data structure something that you built yourself, or do you get it from another program or a subroutine/module call that you have not shown?
If you're building it yourself, then change it to something like:
(Parens instead of curlies for the external delimiters.)%update = ( '2'=>{ '25' => { 'i' => 5000000, 'o' => 5000000 }, '4' => { 'o' => 5000000, 'i' => 5000000 } } );
If you're getting that hash ref data structure from somewhere else (e.g. another program or another part of your program), then you probably need to change your foreach loops to use a hashref instead of a hash. For example, change the foreach my $i (keys %update) line to something that uses an hash ref rather than a hash, for example, assuming your data hashref is $update, something like:
foreach my $i (keys %$update) { #...
|
|---|