pipe READOUT, WRITEOUT; if (my $pid = fork) { close(WRITEOUT); # try to read from READOUT, which fails. } else { close(STDERR); close(STDOUT); open(STDOUT, ">&WRITEOUT"); # This next line makes no difference. select(STDOUT); $|=1; exec("some_application"); }