Perl Programming Documentation
Download Perl
Explore

Manual

- Overview
- Tutorials
- FAQs
- History / Changes
- License

Reference

- Language
- Functions
- Operators
- Special Variables
- Pragmas
- Utilities
- Internals
- Platform Specific

Modules

- A • B • C • D • E
- F • G • H • I • L
- M • N • O • P • S
- T • U • X

Tools

- Preferences

# rename

Perl 5 version 16.0 documentation
Go to top
Show recent pages
Recently read

# rename

Perl functions A-Z | Perl functions by category | The 'perlfunc' manpage

- rename OLDNAME,NEWNAME

  Changes the name of a file; an existing file NEWNAME will be clobbered. Returns true for success, false otherwise.

  Behavior of this function varies wildly depending on your system implementation. For example, it will usually not work across file system boundaries, even though the system mv command sometimes compensates for this. Other restrictions include whether it works on directories, open files, or pre-existing files. Check perlport and either the rename(2) manpage or equivalent system documentation for details.

  For a platform independent `move` function look at the File::Copy module.

  Portability issues: rename in perlport.