open my $fh, '>', $state_file or die "open($state_file): $!"; print $fh "RUNNING" or die "print($state_file): $!"; close($fh) or die "close($state_file): $!";