Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: Sort on Number Embedded in String

by JediWizard (Deacon)
on Mar 22, 2005 at 19:12 UTC ( [id://441573]=note: print w/replies, xml ) Need Help??


in reply to Sort on Number Embedded in String

You could use a Schwartzian Transform. see http://www.sysarch.com/perl/sort_paper.html

for (map $_->[1] => sort {$a->[0] <=> $b->[0]} map {m/fwlogsum\.(\d+)\w+/; [$1, $_]} @files ){ print "fwlog" . $_ . ".Mar2005\n"; }

A truely compassionate attitude towards other does not change, even if they behave negatively or hurt you

—His Holiness, The Dalai Lama

Log In?
Username:
Password:

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

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

    No recent polls found