1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
|
.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.43)
.\"
.\" 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
..
.\" Set up some character translations and predefined strings. \*(-- will
.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
.\" double quote, and \*(R" will give a right double quote. \*(C+ will
.\" give a nicer C++. Capital omega is used to do unbreakable dashes and
.\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff,
.\" nothing in troff, for use with C<>.
.tr \(*W-
.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
.ie n \{\
. ds -- \(*W-
. ds PI pi
. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch
. ds L" ""
. ds R" ""
. ds C` ""
. ds C' ""
'br\}
.el\{\
. ds -- \|\(em\|
. ds PI \(*p
. ds L" ``
. ds R" ''
. 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 "2024-01-01" "perl v5.36.0" "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 "\s-1USE OPTIONS\s0"
.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(CW\*(C`rename()\*(C'\fR. The
configuation options are preceded by :config,
and are passed to File::Rename::Options.
.SS "\s-1FUNCTIONS\s0"
.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 \s-1FILES\s0 using \s-1CODE,\s0
if \s-1FILES\s0 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 \s-1FILES\s0 using \s-1CODE\s0
.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 \s-1HANDLE,\s0 using \s-1CODE\s0
.SS "\s-1OPTIONS\s0"
.IX Subsection "OPTIONS"
.IP "\s-1FILES\s0" 8
.IX Item "FILES"
List of files to be renamed,
for \f(CW\*(C`rename\*(C'\fR must be an \s-1ARRAY\s0 reference
.IP "\s-1CODE\s0" 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 "\s-1VERBOSE\s0" 8
.IX Item "VERBOSE"
Flag for printing names of files successfully renamed,
optional for \f(CW\*(C`rename\*(C'\fR
.IP "\s-1HANDLE\s0" 8
.IX Item "HANDLE"
Filehandle to read file names to be renames
.IP "\s-1FILENAME\s0 (Optional)" 8
.IX Item "FILENAME (Optional)"
Name of file that \s-1HANDLE\s0 reads from
.SS "\s-1HASH\s0"
.IX Subsection "HASH"
Either \s-1CODE\s0 or \s-1VERBOSE\s0 can be a \s-1HASH\s0 of options.
.PP
If \s-1CODE\s0 is a \s-1HASH, VERBOSE\s0 is ignored
and \s-1CODE\s0 is supplied by the \fB_code\fR key.
.PP
Other options are
.IP "\fBverbose\fR" 16
.IX Item "verbose"
As \s-1VERBOSE\s0 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 "\s-1EXPORT\s0"
.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 <RMBarker@cpan.org>
.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.
|