GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
File::Rename(3) User Contributed Perl Documentation File::Rename(3)

File::Rename - Perl extension for renaming multiple files

  use File::Rename qw(rename);          # hide CORE::rename
  rename \@ARGV, sub { s/\.pl\z/.pm/ }, 1;
  use File::Rename;
  File::Rename::rename \@ARGV, '$_ = lc';
  use File::Rename qw(:config no_require_order);

Parameters to "use File::Rename" consists of functions to be imported and configuration options.

The only exported function is rename(). The configuation options are preceded by :config, and are passed to File::Rename::Options.

"rename( FILES, CODE [, VERBOSE])"
rename FILES using CODE, if FILES is empty read list of files from stdin
"rename_files( CODE, VERBOSE, FILES)"
rename FILES using CODE
"rename_list( CODE, VERBOSE, HANDLE [, FILENAME])"
rename a list of file read from HANDLE, using CODE

List of files to be renamed, for "rename" must be an ARRAY reference
Subroutine to change file names, for "rename" can be a string, otherwise it is a code reference
Flag for printing names of files successfully renamed, optional for "rename"
Filehandle to read file names to be renames
Name of file that HANDLE reads from

Either CODE or VERBOSE can be a HASH of options.

If CODE is a HASH, VERBOSE is ignored and CODE is supplied by the _code key.

Other options are

As VERBOSE above, provided by -v.
Input separator \0 when reading file names from stdin.
Print names of files to be renamed, but do not rename (i.e. take no action), provided by -n.
Allow files to be over-written by the renaming, provided by -f.
Only apply renaming to the filename component of the path, provided by -d.
Print help, provided by -h.
Print manual page, provided by -m.
Print version number, provided by -V.
Enable unicode_strings feature, provided by -u.
Encoding for filenames, provided by -u.

rename

No environment variables are used.

mv(1), perl(1), rename(1)

Robin Barker <RMBarker@cpan.org>

Based on code from Larry Wall.

Options -e, -f, -n suggested by more recent code written by Aristotle Pagaltzis.

Errors from the code argument are not trapped.

Copyright (C) 2004, 2005, 2006, 2011, 2018, 2021, 2022, 2023 by Robin Barker

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.

2023-01-19 perl v5.40.2

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.