Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re: sorting files

by psini (Deacon)
on May 29, 2008 at 14:37 UTC ( #689026=note: print w/replies, xml ) Need Help??


in reply to sorting files

It could be ok, it depends on what you are expecting it to do...

As you have written you are extracting only the "02" part of the filename in $first_number and the "20061022" part in $second_number. I don't really believe it is what you meant to do :)

Please better explain what you are trying: in the example filename there are 4 numeric parts and you should at least decide the order of precedence between them (which are to be sort before). Secondly, if the format of the string is known (length of the numeric parts, for instance) there could be efficient ways than in the generic case.

Rule One: Do not act incautiously when confronting a little bald wrinkly smiling man.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (6)
As of 2022-11-30 23:58 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Notices?