in reply to Sorting with multiple keys
# Create a keysort function that uses two strings as keys: use Sort::Key::Maker ss_keysort => qw(string string); # And then use it. # The first argument passed is the subroutine # to extract the keys from the data: my @sorted_by_type_and_author = ss_keysort { /^name=.*? type=(.*?) author=(.*?)$/; ($1, $2) } @lines;
|
|---|