ikegami already answered your question, but as a comment on style, in this case I think this would be easier to read:
my @sort2 = sort { $a->{ salary } <=> $b->{ salary } } @workers;
the lowliest monk
In reply to Re: Sorting an array of records
by tlm
in thread Sorting an array of records
by fruitbeeriswrong
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |