Expect the Unexpected 

open my $fh, '>', $state_file;

print $fh "RUNNING";

close($fh);