+# This script was developed by Robin Barker (Robin.Barker@npl.co.uk),
+# from Larry Wall's original script eg/rename from the perl source.
+# This script is free software; you can redistribute it and/or modify it
+# under the same terms as Perl itself.
+# Larry(?)'s RCS header:
+# RCSfile: rename,v Revision: 4.1 Date: 92/08/07 17:20:30
+# $RCSfile: rename,v $$Revision: 1.5 $$Date: 1998/12/18 16:16:31 $
+# Revision 1.5 1998/12/18 16:16:31 rmb1
+# changed man documentation to POD
+# Revision 1.4 1997/02/27 17:19:26 rmb1
+# corrected usage string
+# Revision 1.3 1997/02/27 16:39:07 rmb1
+# Revision 1.2 1997/02/27 16:15:40 rmb1
+# *** empty log message ***
+# Revision 1.1 1997/02/27 15:48:51 rmb1
+my ($verbose, $no_act, $force, $op);
+die "Usage: rename [-v] [-n] [-f] perlexpr [filenames]\n"
+ 'v|verbose' => \$verbose,
+ 'n|no-act' => \$no_act,
+ print "reading filenames from STDIN\n" if $verbose;
+ next if $was eq $_; # ignore quietly
+ warn "$was not renamed: $_ already exists\n";
+ elsif ($no_act or rename $was, $_)
+ print "$was renamed as $_\n" if $verbose;
+ warn "Can't rename $was $_: $!\n";
+rename - renames multiple files
+B<rename> S<[ B<-v> ]> S<[ B<-n> ]> S<[ B<-f> ]> I<perlexpr> S<[ I<files> ]>
+renames the filenames supplied according to the rule specified as the
+argument is a Perl expression which is expected to modify the C<$_>
+string in Perl for at least some of the filenames specified.
+If a given filename is not modified by the expression, it will not be
+If no filenames are given on the command line, filenames will be read
+For example, to rename all files matching C<*.bak> to strip the extension,
+ rename 's/\.bak$//' *.bak
+To translate uppercase names to lower, you'd use
+=item B<-v>, B<--verbose>
+Verbose: print names of files successfully renamed.
+=item B<-n>, B<--no-act>
+No Action: show what files would have been renamed.
+Force: overwrite existing files.
+No environment variables are used.
+If you give an invalid Perl expression you'll get a syntax error.
+The original C<rename> did not check for the existence of target filenames,
+so had to be used with care. I hope I've fixed that (Robin Barker).