Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re^2: Sort - can't

by tlm (Prior)
on Aug 29, 2005 at 01:33 UTC ( [id://487319]=note: print w/replies, xml ) Need Help??


in reply to Re: Sort - can't
in thread Sort - can't

Sort what by what?

Your code is too way off for me to decipher your intentions.

If you want to sort the filenames by the substring after the last _, then I'd do something like

my @sorted = map $_->[ 0 ], sort { $a->[ 1 ] cmp $b->[ 1 ] } map [ $_, ( split '_' )[ -1 ] ], @unsorted;
(untested).

the lowliest monk

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others sharing their wisdom with the Monastery: (1)
As of 2024-04-25 00:25 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found