#!/usr/sbin/perl
{
opendir(THISDIR,".");
@allfiles = grep(!/^\.\.?$/, readdir(THISDIR));
closedir(THISDIR);
$numfiles = @allfiles;
for ($i=0 ; $i<$numfiles ; $i++) {
($base, $ext) = split(/\./,$allfiles[$i]);
if ($base =~ /[^a-z0-9\137]/) {
 ($newfile = $allfiles[$i] ) =~ tr/\055/\137/;
 print "mv ",$allfiles[$i],' ',$newfile,"\n";}
if ($ext =~ /[^a-z0-9\137]/) {
 print "mv ",$allfiles[$i],' ',$allfiles[$i],"\n";}
if (length($base) > 8) {
 print "mv ",$allfiles[$i],' ',$allfiles[$i],"\n";}
if (length($ext) > 3) {
 print "mv ",$allfiles[$i],' ',$allfiles[$i],"\n";}
}
}

