in reply to RE: RE: Re: Sorting on Section Numbers
in thread Sorting on Section Numbers

@sorted = map {$_->[0], ", "} sort {$a->[0] <=> $b->[0]} map {[$_, pack ("N*", $_)]} @unsorted;

For anyone who doesn't understand what the above code does, here are some nodes with explanations of the technique and some interesting discussion:

<list>
  • Schwartzian Transform
  • Sorting IP Addresses Quickly
  • A Fresh Look at Efficient Perl Sorting (thanks davorg)
  • -Matt