Try this:
Which yielded the following for me: (even though the data was already sorted by 'policy_number')use Data::Dumper; for ( sort { $a->{policy_number} cmp $b->{policy_number}} @{ $VAR1->{p +olicies} }) { print Dumper $_; }
$VAR1 = { 'name' => 'ZAbc', 'description' => 'This is where the description goes.', 'link_name' => '7080-A103 zAbc.doc', 'policy_number' => '7080-A103' }; $VAR1 = { 'name' => 'Def', 'description' => 'This is where the description goes.', 'link_name' => '7080-D100 ef.doc', 'policy_number' => '7080-D100' }; $VAR1 = { 'name' => 'Pqrs', 'description' => 'This is where the description goes.', 'link_name' => '7080-E102 Pqrs.doc', 'policy_number' => '7080-E102' };
jeffa
L-LL-L--L-LL-L--L-LL-L-- -R--R-RR-R--R-RR-R--R-RR B--B--B--B--B--B--B--B-- H---H---H---H---H---H--- (the triplet paradiddle with high-hat)
In reply to Re^3: XML::Simple Not Sorting
by jeffa
in thread XML::Simple Not Sorting
by bkiahg
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |