sub foo {last if (/^d/i); push @nod, $_} find (\&foo, "/somedir");
The above code pushes all filenames in the /somedir directory except the files beginning with 'd|D'. What I need is just the files that come before the files beginning with 'd|D'.
TIA
Update:
I tried to give an example that simplified what I need, I guess I simplified too much. I'll try to elaborate.
The process I'm creating needs to iterate through a given directory and any sub directories recursivley. As it goes through these files it needs to open each regular file it finds and evaluate the contents of the file to determine the file type (ascii data, binary data, xml, html, empty, etc) based on several specific rules I need to abandon the find and reset, then move to the next iteration of the outer loop (not seen in above example). The more I think about this, and the more I read from this thread, the more I believe that File::Find may not be the best mechanism for recursivley iterating through the files(in this case). But I'm not sure of how to do it any other way without risking the pitfalls of recursion.
If anyone has suggestions I'd be greatful.
Thanks Again!
In reply to File::Find exit by sweetblood
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |