|
|
| No such thing as a small change | |
| PerlMonks |
Re^3: Searching for files efficiently help!by aaron_baugher (Chaplain) |
| on Nov 16, 2011 at 22:22 UTC ( #938480=note: print w/ replies, xml ) | Need Help?? |
|
There would seem to be two ways you can do this (but see correction below):
Generally, I would prefer the first method. It's almost certain to be faster to go through a list of files and check for their existence than to traverse an entire directory structure and check every file against a list. If you simply go through your array, checking for the existence of each pathname and deleting if it's found, then it doesn't matter how large or complex your directory structure is.
Correction: As Jethro pointed out, I misunderstood the original requirements, getting the two arrays he mentioned mixed up. The array he wants to check the files against does not have full path names, so my solution won't work. He will have to recurse through the directory structure and check them one by one. Aaron B.
In Section
Seekers of Perl Wisdom
|
|
||||||||||||||||||||||