$SIG{PIPE} = "IGNORE"; open(my $fh, "|-", "bogus") || die "can't fork: $!"; print $fh "bang\n"; close($fh) || die "can't close: status=$?";