It's also worth looking at Sort::Key which adds a nicer sorting syntax to Perl.
Instead of the usual:
@sorted = sort { uc $a cmp uc $b } @list;You can just write:
@sorted = keysort { uc } @list;You can even sort arrays in place:
keysort_inplace { uc } @list; # And now @list itself is sorted. We don't # need to create a new array called @sorted.
In reply to Re: short sorts
by tobyink
in thread short sorts
by Lady_Aleena
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |