Problems? Is your data what you think it is? | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
The issue, though, from my standpoint, is that File::Find doesn't offer any means (at least as far as I can think of... please tell me if I'm wrong) to turn it's use inside-out... that is, if you will, to ask File::Find for a file, rather than be told by File::Find that there is a file. Well, to me what you are doing is transforming directories into a list of files right? So the code would be:
Which then makes your code become:
Note that this code replaces FWICT your entire doesnt repeatedly stat files it already has, and is robust and portable, and could obviously be inlined further and provides a while host of filtering and hooks with low effort. All you have to do is wrap your tie logic around it and presto... Also I bypassed the point about not putting the entire tree into the array. I suspect that you will find that in order to prevent circular directory structures blowing you out of the water you are going to have to store all the visited directories, which essentially means hold the whole lot in memory. Essentially I dont see this as a particularly good idea.
---
demerphq First they ignore you, then they laugh at you, then they fight you, then you win.
In reply to Re: Re: Re: Re: Re: Re^4 Useful addition to Perl?
by demerphq
|
|