.\" -*- mode: troff; coding: utf-8 -*- .\" Automatically generated by Pod::Man 5.0102 (Pod::Simple 3.45) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>. .ie n \{\ . ds C` "" . ds C' "" 'br\} .el\{\ . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "File::Rename 3pm" .TH File::Rename 3pm 2026-05-05 "perl v5.40.1" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH NAME File::Rename \- Perl extension for renaming multiple files .SH SYNOPSIS .IX Header "SYNOPSIS" .Vb 2 \& use File::Rename qw(rename); # hide CORE::rename \& rename \e@ARGV, sub { s/\e.pl\ez/.pm/ }, 1; \& \& use File::Rename; \& File::Rename::rename \e@ARGV, \*(Aq$_ = lc\*(Aq; \& \& use File::Rename qw(:config no_require_order); .Ve .SH DESCRIPTION .IX Header "DESCRIPTION" .SS "USE OPTIONS" .IX Subsection "USE OPTIONS" Parameters to \f(CW\*(C`use File::Rename\*(C'\fR consists of functions to be imported and configuration options. .PP The only exported function is \f(CWrename()\fR. The configuation options are preceded by :config, and are passed to File::Rename::Options. .SS FUNCTIONS .IX Subsection "FUNCTIONS" .ie n .IP """rename( FILES, CODE [, VERBOSE])""" 4 .el .IP "\f(CWrename( FILES, CODE [, VERBOSE])\fR" 4 .IX Item "rename( FILES, CODE [, VERBOSE])" rename FILES using CODE, if FILES is empty read list of files from stdin .ie n .IP """rename_files( CODE, VERBOSE, FILES)""" 4 .el .IP "\f(CWrename_files( CODE, VERBOSE, FILES)\fR" 4 .IX Item "rename_files( CODE, VERBOSE, FILES)" rename FILES using CODE .ie n .IP """rename_list( CODE, VERBOSE, HANDLE [, FILENAME])""" 4 .el .IP "\f(CWrename_list( CODE, VERBOSE, HANDLE [, FILENAME])\fR" 4 .IX Item "rename_list( CODE, VERBOSE, HANDLE [, FILENAME])" rename a list of file read from HANDLE, using CODE .SS OPTIONS .IX Subsection "OPTIONS" .IP FILES 8 .IX Item "FILES" List of files to be renamed, for \f(CW\*(C`rename\*(C'\fR must be an ARRAY reference .IP CODE 8 .IX Item "CODE" Subroutine to change file names, for \f(CW\*(C`rename\*(C'\fR can be a string, otherwise it is a code reference .IP VERBOSE 8 .IX Item "VERBOSE" Flag for printing names of files successfully renamed, optional for \f(CW\*(C`rename\*(C'\fR .IP HANDLE 8 .IX Item "HANDLE" Filehandle to read file names to be renames .IP "FILENAME (Optional)" 8 .IX Item "FILENAME (Optional)" Name of file that HANDLE reads from .SS HASH .IX Subsection "HASH" Either CODE or VERBOSE can be a HASH of options. .PP If CODE is a HASH, VERBOSE is ignored and CODE is supplied by the \fB_code\fR key. .PP Other options are .IP \fBverbose\fR 16 .IX Item "verbose" As VERBOSE above, provided by \fB\-v\fR. .IP \fBinput_null\fR 16 .IX Item "input_null" Input separator \e0 when reading file names from stdin. .IP \fBno_action\fR 16 .IX Item "no_action" Print names of files to be renamed, but do not rename (i.e. take no action), provided by \fB\-n\fR. .IP \fBover_write\fR 16 .IX Item "over_write" Allow files to be over-written by the renaming, provided by \fB\-f\fR. .IP \fBfilename_only\fR 16 .IX Item "filename_only" Only apply renaming to the filename component of the path, provided by \fB\-d\fR. .IP \fBshow_help\fR 16 .IX Item "show_help" Print help, provided by \fB\-h\fR. .IP \fBshow_manual\fR 16 .IX Item "show_manual" Print manual page, provided by \fB\-m\fR. .IP \fBshow_version\fR 16 .IX Item "show_version" Print version number, provided by \fB\-V\fR. .IP \fBunicode_strings\fR 16 .IX Item "unicode_strings" Enable unicode_strings feature, provided by \fB\-u\fR. .IP \fBencoding\fR 16 .IX Item "encoding" Encoding for filenames, provided by \fB\-u\fR. .SS EXPORT .IX Subsection "EXPORT" rename .SH ENVIRONMENT .IX Header "ENVIRONMENT" No environment variables are used. .SH "SEE ALSO" .IX Header "SEE ALSO" \&\fBmv\fR\|(1), \fBperl\fR\|(1), \fBrename\fR\|(1) .SH AUTHOR .IX Header "AUTHOR" Robin Barker .SH Acknowledgements .IX Header "Acknowledgements" Based on code from Larry Wall. .PP Options \fB\-e\fR, \fB\-f\fR, \fB\-n\fR suggested by more recent code written by Aristotle Pagaltzis. .SH DIAGNOSTICS .IX Header "DIAGNOSTICS" Errors from the code argument are not trapped. .SH "COPYRIGHT AND LICENSE" .IX Header "COPYRIGHT AND LICENSE" Copyright (C) 2004, 2005, 2006, 2011, 2018, 2021, 2022, 2023 by Robin Barker .PP This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.4 or, at your option, any later version of Perl 5 you may have available.