Perl Programming/Keywords/rename
The rename keyword
editThe 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
edit rename OLDNAME, NEWNAME
Examples
editrename "barewords.pl" "bareword.pl"