http://www.perlmonks.org?node_id=236786


in reply to Renaming Files

I strongly recommend File::Find. Here's an example of what it might look like:
use File::Find; my $dir = shift || '.'; find \&wanted, $dir; sub wanted { next unless (-f && /\.cfm$/); my $newname = $File::Find::name; $newname =~ s/\.cfm$/.html/; rename $File::Find::name,$newname or die "Unable to rename $File::F +ind::name!"; }

Cheers,
Shendal