Just out of curiosity: why put all your filenames in an array, and then loop through the array to work on them? I'm guessing you did that to get a depth-first traversal, so it wouldn't change a directory name and then be unable to get at the files beneath it. If that's the case, you could use the finddepth() method of File::Find.
Then you could just put the stuff inside your for loop into the sub you're passing to finddepth(). That'd avoid the potential problem of @found filling a lot of memory on a large directory structure, and you wouldn't need to call basename() and dirname() because your callback would already get those values in $File::Find::dir and $_.
Aaron B.
My Woefully Neglected Blog, where I occasionally mention Perl.
In reply to Re: Recursive renaming script
by aaron_baugher
in thread Recursive renaming script
by amr noman
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |