#!/usr/bin/perl -wT use strict; $SIG{'PIPE'} = 'IGNORE'; $| = 1; my $pid = open CONSUMER, '|-'; if (!defined $pid) { die "cannot fork: $!"; } if (!$pid) { open STDOUT, '/dev/null'; my $msg = ; exit(0); } print CONSUMER "hi there\n" or die "cannot write to pipe: $!"; close CONSUMER or die $! ? "error closing pipe: $!" : "child exit status: $?"; print "done, satisfied\n";