if(!defined $pid){ die "$runs: $!"; } OR if(!defined $pid){ print FILE "undefined at $runs\n"; $runs--; next; }