use warnings; use strict; foreach my $file (<*>) { if ($file =~ m/(.*)/) { #we trust everything from *our* box $file = $1; my $rc = system("rm", $file); } } #### -rw-rw-r-- 1 thulben thulben 1 Feb 24 11:03 -rf -rwxr-xr-x 1 thulben thulben 254 Feb 24 10:59 unsafe.pl*