smackdab has asked for the wisdom of the Perl Monks concerning the following question:
Is it because of Win32 or is there a more standard way of doing this?use IO::Handle; pipe(READER, WRITER); WRITER->autoflush(1); if ($pid = fork) { close WRITER; my $buf = ""; while (<READER>) { $buf .= $_; } chomp($buf); print "Parent Pid $$ just read this:\n$buf\n"; close READER; waitpid($pid, 0); } else { die "cannot fork: $!" unless defined $pid; close READER; # my $out = `ping 555-1212`; print WRITER "Child Pid $$ is sending this\n"; print PARENT_WRT $out; close WRITER; exit; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Forked up
by tachyon (Chancellor) on Oct 09, 2001 at 07:09 UTC | |
by smackdab (Pilgrim) on Oct 09, 2001 at 07:33 UTC | |
by tachyon (Chancellor) on Oct 09, 2001 at 08:26 UTC | |
by smackdab (Pilgrim) on Oct 09, 2001 at 19:29 UTC | |
|
Re: Forked up
by CubicSpline (Friar) on Oct 09, 2001 at 07:08 UTC | |
by John M. Dlugosz (Monsignor) on Oct 09, 2001 at 07:16 UTC |