You don't return the elements from the sort block, you return -1, 1 or 0 depending on whether $a or $b was greater or they were equal. See perldoc -f sort.
You don't need to pass $a / $b explicitly that way, they're special globals.
@sorted = sort &by_date keys %reversed;
Makeshifts last the longest.
In reply to Re: Sorting Criteria
by Aristotle
in thread Sorting Criteria
by wizard341
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |