Sound like you want to sort by parent and then by message ID. Something like this will work:
--my @sorted = sort { $a->{parent} <=> $b->{parent} || $a->{messageId} <=> $b->{messageId} } @$testarray; foreach (@sorted) { print "$_->{messageId}\t$_->{parent}\n"; }
"The first rule of Perl club is you do not talk about
Perl club."
-- Chip Salzenberg
In reply to Re: Sorting an Array of Hashes (AoH) by its keys as a threaded message
by davorg
in thread Sorting an Array of Hashes (AoH) by its keys as a threaded message
by BMaximus
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |