use strict; MAIN: { my $pid = $ARGV[0]; if (kill 0 => $pid) { print STDOUT "Process '$pid' exists\n"; } else { print STDOUT "Process '$pid' does not exist\n"; } }