in reply to Re^2: Changing filename extensions
in thread filenames

rename("$dir/$name.$old", "$dir/$name.$new");

Replies are listed 'Best First'.
Re^4: Changing filename extensions
by eyepopslikeamosquito (Archbishop) on Nov 16, 2021 at 07:22 UTC

    Given the OP is a Perl newbie, just a further clarification that when running Perl on Windows, forward slashes are preferred to backslashes. This enhances code portability because they work fine in file paths when using Perl on both Unix and Windows (as described in more detail at Re^4: windows perl and paths) and boosts enjoyment because they are easier to type and read than ugly escaped backslashes. :)

Re^4: Changing filename extensions
by supernova95 (Initiate) on Nov 16, 2021 at 04:03 UTC
    That did the trick, tysm!