in reply to Building a sorting subroutine on the fly
use Sort::Key qw(multikeysorter); # ascending last, ascending first: $sorter = multikeysorter(sub { lc $_->[0], lc $_->[1] }, qw(string, string)); @sorted = &$sorter(values %data) # ascending first, descending last: $sorter = multikeysorter(sub { lc $_->[1], lc $_->[0] }, qw(string, -string)); @sorted = &$sorter(values %data)
|
|---|