The logic for multiple sorting is as follows,
That works by the lazy evaluation of logical operators. If comparison by level is not a tie, the department comparison is not made.my @sorted = sort { $a->{'level'} <=> $b->{'level'} || $a->{'department'} cmp $b->{'department'} } @array;
After Compline,
Zaxo
In reply to Re: Logic for sorting of this given array
by Zaxo
in thread Logic for sorting of this given array
by ravish
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |