my $file = 'c:\temp\running.tmp'; open(RUNNING, ">$file"); close(RUNNING); ##Do your stuff unlink($file);