in reply to Copy and Rename file at destination directory

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

Replies are listed 'Best First'.
Re: Re: Copy and Rename file at destination directory
by Skyler99 (Novice) on Jun 04, 2003 at 04:43 UTC
    PZbagel should I do "my $newfile = shift; or how could I pass it to the structure??

      Exactly, now try the print statement debugging idea and let us know what you find.