/ /home/httpd/lonUsers my $checkfile='/home/httpd/html/lon-status/removed_bad_calaculatedsheets'; if ( -e $checkfile ) { exit; } # get a list of files my @files=`find -name nohist_calculatedsheets*`; foreach my $file (@files) { chomp($file); unlink($file); } `touch $checkfile`