Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things

Re^2: rename files with mtime

by grinder (Bishop)
on Feb 15, 2009 at 10:00 UTC ( #743928=note: print w/replies, xml ) Need Help??

in reply to Re: rename files with mtime
in thread rename files with mtime

Speaking of idioms...

after which you can say
rename $file, $new_name;

The following idiom helps prevents renaming disasters:

rename $file, $new_name unless -e $new_name;

That is, don't rename a file if it would cause an existing file to be unlinked. It's easier to fix up the mess of a file that hasn't been renamed than one that no longer exists...

• another intruder with the mooring in the heart of the Perl

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://743928]
[LanX]: damn sun ...blame Ophelia!
[choroba]: Yesterday, I gave Ramirez a headshot through the gate in Aztec. LOL. What happened to you? WTF? Sun. There was a hole in the window foil.
[LanX]: headshot ?

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (10)
As of 2017-10-18 14:06 GMT
Find Nodes?
    Voting Booth?
    My fridge is mostly full of:

    Results (245 votes). Check out past polls.