411 REFERENCE · Wikibooks
Perl Programming/Keywords/rename
Reference material by Wikibooks contributors. This retains its source identity and is not 411 news reporting.
Perl ref require Keywords
The rename keyword
The rename function changes the file name given in OLDNAME. An existing file with the name of NEWNAME will be clobbered. Returns true on success and false otherwise.
The behaviour of the rename function varies widely, depending on the implementation on the operating system. It will often not work over file system boundaries, although mv on UNIX-like systems will sometimes work. Other restrictions may be whether it works on directories, open files, or pre-existing files.
Syntax
rename OLDNAME, NEWNAME
Examples
rename "barewords.pl" "bareword.pl"
Perl ref require Keywords