File::Irenamer - Perform interactive filename changes from within an editor
use Irenamer; InteractiveRename(); InteractiveRename(verbose); InteractiveRename(recurse); InteractiveRename(debug); InteractiveRename(recurse,verbose,debug); Recognizes up to three optional switches: -d debug mode -r recurse mode -v verbose mode E.g. $ perl -MFile::Irenamer -e 'InteractiveRename()' $ perl -MFile::Irenamer -e 'InteractiveRename(verbose)' /tmp/mydir or via a separate script: $ cat mytest.pl #!/usr/bin/perl use strict; use warnings; use File::Irenamer; InteractiveRename(); $ mytest.pl -dv ~/mydir
Interactive file renamer module allows filename changes from within your favorite editor.
It is most useful when complicated or one-time repetitive changes to a directory or directory tree must be made but programmatic solutions are probably not worth the time to implement. Defaults to 'do not recurse'.
It exports a single function called InteractiveRename()
It assumes a Unix-like environment that exports $EDITOR. If you're on Win32, Cygwin works well. Otherwise you can try to set $ENV{EDITOR} in the code that calls InteractiveRename().
Verbose mode is highly recommended, at least initially, since there is no prompting nor undo available.
None by default.
Code is blissfully unaware of filesystem permissions.
Tempfile creation is not craker-proofed.
Perl's rename function
www.vim.org
Robert S. Heckel Jr., <bheckel@gmail.com<gt>
Copyright (C) 2004 by Robert S. Heckel Jr.
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.2 or, at your option, any later version of Perl 5 you may have available.
I've used this code reliably for quite a while but, as you'd expect, I cannot take responsibility for any damage to your files (or your foot should you choose to shoot it) so obviously use it at your own risk.
To install File::Irenamer, copy and paste the appropriate command in to your terminal.
cpanm
cpanm File::Irenamer
CPAN shell
perl -MCPAN -e shell install File::Irenamer
For more information on module installation, please visit the detailed CPAN module installation guide.