in reply to Re: Renames files and directories but won't update files at the same time.
in thread Renames files and directories but won't update files at the same time.

The construct

if (/(CAPTURE BEFORE)REGEX(CAPTURE AFTER)/) { s/(CAPTURE BEFORE)REGEX(CAPTURE AFTER)/$1REPLACEMENT$2/; }

is better written as a simple

s/REGEX/REPLACEMENT/;

— Arien