R
Raj
Hi,
I have a need to sort a hash of hashes! I know it already sounds
complicated, but its the only way I can think of holding the results of the
analysis of some data.
The hash has entries like:
$ips{"F1234"}{"telephone"} = "02088887777"
$ips{"F1234"}{"charge"} = 1000
$ips{"F1234"}{"err_type"} = 0
$ips{"F6638"}{"telephone"} = "02077776666"
$ips{"F6638"}{"charge"} = 500
$ips{"F6638"}{"err_type"} = 2
$ips{"B7877"}{"telephone"} = "02077756666"
$ips{"B7877"}{"charge"} = 445
$ips{"B7877"}{"err_type"} = 2
I need to sort it using the key "err_type"....is this easy? I've never
understood sorting in Perl and so would appreciate any help you can give me.
"err_type" is always a number, if that's relevant!
Thanks in advance,
- raj
I have a need to sort a hash of hashes! I know it already sounds
complicated, but its the only way I can think of holding the results of the
analysis of some data.
The hash has entries like:
$ips{"F1234"}{"telephone"} = "02088887777"
$ips{"F1234"}{"charge"} = 1000
$ips{"F1234"}{"err_type"} = 0
$ips{"F6638"}{"telephone"} = "02077776666"
$ips{"F6638"}{"charge"} = 500
$ips{"F6638"}{"err_type"} = 2
$ips{"B7877"}{"telephone"} = "02077756666"
$ips{"B7877"}{"charge"} = 445
$ips{"B7877"}{"err_type"} = 2
I need to sort it using the key "err_type"....is this easy? I've never
understood sorting in Perl and so would appreciate any help you can give me.
"err_type" is always a number, if that's relevant!
Thanks in advance,
- raj