in reply to Trying to rename files in directory
I could be wrong but try it without the "eg" in the substitution:
And then change your warning to:s/^([^_]+_)(.*)(\.\w{3,4})\z$/$3/;
to see what else is happening. If that's no good put inwarn "Couldn't rename $temp_f_name to $renamed_file, $!\n";
before the rename()print "About to rename $temp_f_name to $renamed_file\n";
|
---|
In Section
Seekers of Perl Wisdom