in reply to File Extension Renaming

You're changing the value of $zips but that doesn't change the name of the file any more than writing "deposit $4_000_000_000" in your checkbook will add money to your checking account; you've got to use rename to tell the operating system to rename the file (alas, I don't know the Perl function to add money to my checking account).

Try something like this:

opendir(DIR,$destinationdirectory) or die "Could not open $destination +directory because $!\n"; foreach (my $zips = readdir(DIR)){ ($txt = $zips) =~ s/\.log$/.txt/i; unless(rename($zips, $txt)){ warn "could not rename $zips to $txt because $!\n"; next; } }
Warning Code was NOT tested.


minor update

In addition to the advice about collisions, you should probably check permissions on the directory holding the files to be renamed.

emc

e(π√−1) = −1