Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re: The situational efficiency of File::Find

by SilverB1rd (Scribe)
on May 09, 2001 at 18:10 UTC ( #79087=note: print w/replies, xml ) Need Help??


in reply to The situational efficiency of File::Find

If you have lots of files you can brake it down into 2 readdirs.

Untested script
@UserDirectorys = (); opendir (DIR, "/user/"); @UserDirectorys = grep {not /^(\.\.?)$/} // probably not the best wa +y to do this readdir(DIR); closedir (DIR); foreach $USER ( @UserDirectorys ) { @UserFiles = (); opendir (DIR, "/user/$USER"); @UserFiles = readdir(DIR); closedir (DIR); # Search @UserFiles for files needed.... }
This way you would not have to read in every file from every folder at one time.

------
The Price of Freedom is Eternal Vigilance

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (4)
As of 2022-08-14 09:14 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?