Another 5 minute hack... j #!/usr/bin/perl opendir DIR, "."; @files = grep /^ppm/, readdir DIR; closedir DIR; foreach (@files) { $new = $_; $new =~ s/^ppm/its/; print "rename $_ $new\n"; rename $_, $new; }