Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: read directory

by TedPride (Priest)
on Jul 08, 2006 at 20:07 UTC ( #559953=note: print w/ replies, xml ) Need Help??


in reply to read directory

It might be more efficient to call ls, if the number of files in the directory is large. You certainly don't want to call -M from inside a sort, as shmem suggests.

my @files = split /\n/, `ls -1t`; for (@files) { ... }
The -1 modifier forces output to one column, and -t sorts by last time modified.


Comment on Re: read directory
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (13)
As of 2014-07-28 13:52 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (199 votes), past polls