my $file = 'c:\temp\running.tmp'; open(RUNNING, ">$file"); close(RUNNING); ##Do your stuff unlink($file); #### my $file = 'c:\temp\running.tmp';' if(-e $file){ print "Running\n"; }else{ print "Not Running\n"; }