in reply to How to sort a AoH reference
...or, if you want to retain the rest of your code as you showed it, just enclose the RHS of the assignment to $sorted in []s:
my $sorted = [ sort { $a->{level} <=> $b->{level} || [$a->{menuname} cmp $b->{menuname} } @$sqldata ];
the lowliest monk
|
|---|