in reply to How can I sort this data on the first field
use Sort::Key; my @sorted = ikeysort { /^(\d*)/; $1 } @data;or
or evenmy @sorted = ikeysort { no warnings; int $_ } @data;
my @sorted = sort { no warnings; $a <=> $b } @data;
update: oops, "no warnings" can not be used inside the comparison expression, so...
... has to be used insteadmy @sorted; { no warnings; @sorted = sort { $a <=> $b } @data; }
|
---|