in reply to Help on renaming a bunch of files

I've found the following script very useful for this task. This is the 'rename' script from Programming Perl, 1st Edition, updated a bit for perl5.
#!/usr/local/bin/perl # Usage: rename <perlexpr> [files] ($op = shift) || die "Usage: $0 <perlexpr> [files]\n"; chomp(@ARGV = <STDIN>) unless @ARGV; for (@ARGV) { $was = $_; eval $op; die $@ if $@; rename($was,$_) unless $was eq $_; }
The book also includes some examples of using the script.

Rename files matching *.bak to strip the extension:   rename 's/\.bak$//' *.abc Add the extensions back on:

rename '$_ .= ".bak"' * rename 's/$/.bak/' *
Translate uppercase names to lower:   rename 'tr/A-Z/a-z/' * And more:
rename 's/foo/bar; $_ = $was if -e' *foo* find . -print | rename 's/readme/README/i' find . -print | rename 's/$/.old/ if -M $_ > 0.5' find . -name '*,v' -print | \ rename 's#(.*)/#$1/RCS#, $x{$1}++ || mkdir("$1/RCS", 0777)'
It was sad that the later editions of Programming Perl didn't include the sample scripts, but fortunately the Perl CookBook has since filled that need.