#!/usr/local/bin/perl -w
use File::Find;
find(\&wanted,'.');

sub wanted
{
 return unless -f $_;
 if ($_ eq 'core' || /(%|~|\.(bak|bck|old|undone|orig))$/)
  {
   warn "$File::Find::name\n";
   chmod(0666,$_) unless -w _;
   unlink($_) || warn "Cannot delete $File::Find::name\n";
  }
}

__END__

