use Sort::Key::Multi qw(nn_keysort) # the "nn" prefix means # to use two numeric keys my @data; while (<DATA>) { my @f = /([\d.]+)/g or next; push(@data, \@f); } my @sorted = nn_keysort { $_->[1], $_->[0] } @data; printf("((%f %f) (%f %f))\n", @$_) foreach @sorted;
In reply to Re: Sorting large sets of geometric coordinates
by salva
in thread Sorting large sets of geometric coordinates
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |