...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
In reply to Re: How to sort a AoH reference
by tlm
in thread How to sort a AoH reference
by bradcathey
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |