Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re2: Sorting @lines

by blakem (Monsignor)
on Oct 11, 2002 at 02:54 UTC ( [id://204393]=note: print w/replies, xml ) Need Help??


in reply to Re: Sorting @lines
in thread Sorting @lines

That will break if any of the elements have spaces in them. Probably not very likely, but a safer way to write a GRT is:
my @sorted = map{(split(/\0/))[1]} sort map{sprintf"%09d%09d%s%s\0%s",(split/\./)[0..3],$_} @lines;

-Blake

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others exploiting the Monastery: (6)
As of 2024-04-20 00:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found