Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

RE: RE: RE: Re: Sorting on Section Numbers

by DrManhattan (Chaplain)
on Jul 28, 2000 at 18:37 UTC ( [id://24855]=note: print w/replies, xml ) Need Help??


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

    Log In?
    Username:
    Password:

    What's my password?
    Create A New User
    Domain Nodelet?
    Node Status?
    node history
    Node Type: note [id://24855]
    help
    Chatterbox?
    and the web crawler heard nothing...

    How do I use this?Last hourOther CB clients
    Other Users?
    Others studying the Monastery: (7)
    As of 2024-04-23 10:07 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?

      No recent polls found