#!perl print "Please type filename.???:\n"; $post = <>; chop $post; opendir THISDIR, "." or die "serious dainbramage: $!"; @allfiles = grep !/^\.\.?$/, readdir THISDIR; closedir THISDIR; foreach $file (@allfiles){ if (-d $file){ print "$file ----> Directory.\n"; } elsif ($file eq "postname.pl"){ print "$file ----> Deleted.\n"; } else { $pre = $file; print "$file ----> "; $file =~ s/\..+$//; print "$file.$post\n"; rename "$pre", "$file.$post"; } } unlink ("postname.pl"); exit;