You never set $newfile in sub process_dir. You pass it in but never shift it off @_. Which is poor form even though it seems to work. Other than that, nothing jumps out at me. Since you get no errors, one would tend to thing that those next unless lines are triggering on all entries in the directory. Sprinkle in several print statements and see whether your script even gets to the copy or rename statements. I usually like to print out the inputs of test conditions before doing tests so I can see whether it should have triggered or not.
print "dir: $dir file:$file newfile:$newfile\n"; #before the next unless statements.
HTH
HTH
In reply to Re: Copy and Rename file at destination directory
by pzbagel
in thread Copy and Rename file at destination directory
by Skyler99
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |