NAME
File::PerlMove - Rename files using Perl expressions
SYNOPSIS
use File::PerlMove;
move(sub { $_ = lc }, \@filelist, { verbose => 1 });
DESCRIPTION
File::PerlMove provides a single subroutine: File::PerlMove::move.
move takes three arguments: transform, filelist, and options.
transform must be a string or a code reference. If it is not a string, it is assumed to be a valid Perl expression that will be turned into a anonymous subroutine that evals the expression. If the expression is any of uc
, lc
, of ucfirst
, the resultant code will behave as if these operations would modify $_
in-place. Note, however, that using any of these operations is useless on file systems that are case insensitive, like MS Windows and Mac.
When transform is invoked it should transform a file name in $_
into a new file name.
filelist must be an array reference containing the list of file names to be processed.
options is a hash reference containing options to the operation.
Options are enabled when set to a non-zero (or otherwise 'true') value. Possible options are:
- showonly
-
Show the changes, but do not rename the files.
- link
-
Link instead of rename.
- symlink
-
Symlink instead of rename. Note that not all platforms sypport symlinking,
- reverse
-
Process the files in reversed order.
- overwrite
-
Overwrite existing files.
- createdirs
-
Create target directories if necessary.
- verbose
-
More verbose information.
EXAMPLES
See pmv for examples.
AUTHOR
Johan Vromans <jvromans@squirrel.nl>
COPYRIGHT
This programs is Copyright 2004,2007 Squirrel Consultancy.
This program is free software; you can redistribute it and/or modify it under the terms of the Perl Artistic License or the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.