Speaking of idioms...
after which you can sayrename $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
In reply to Re^2: rename files with mtime
by grinder
in thread rename files with mtime
by pbaumgar
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |