[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Omaha.pm] Rename all files in a directory



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;
}