in reply to Re: File Extension Renaming
in thread File Extension Renaming

Should make that
$new_name =~ s/\.log/\.txt/ig or next;
so that it skips non-.log files .. otherwise the s/// will fail and rename will have identical OLDNAME and NEWNAME arguments.