Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re^3: Changing filename extensions

by jwkrahn (Abbot)
on Nov 16, 2021 at 03:53 UTC ( [id://11138865]=note: print w/replies, xml ) Need Help??


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!

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11138865]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others about the Monastery: (4)
As of 2024-04-23 06:11 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found