You seem to keep shuffling code around. How could the above even be close to working? You have an exit right after you get the directory names. If you take that out, the loop that used to process each one is now commented out. Instead, you're now calling find with the directory $File::Find::dir which is a package variable find initializes during a find ... so you're asking find to look in no directories now (I think) since that would be undefined until a find call is made.
What's going to give you the most mileage here is to break down each piece and start small, adding debugging to make sure it's doing what you think. e.g., instead of jumping directly to trying to traverse directories and copy files, how about traversing them and printing the file names? That way you know what you're getting before you try to copy it. That way you can also show us some output so we can see what the program thinks it's doing.
For me, I think it's time to:
find(\&sleep, $bed);
In reply to Re: finding files and copying them using File::Fiind & File::Copy
by steves
in thread finding files and copying them using File::Fiind & File::Copy
by skyler
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |