blahblah has asked for the wisdom of the Perl Monks concerning the following question:
open(P, "|-") or # fork a process using fh # P as STDIN to the child. do { # huh? Why would open P fail... # and we launch child?!? open(STDERR,">&=$err"); # alias STDERR to output # to the $err filehandle open(STDOUT,">&=$out"); # alias STDOUT to output # to the $out filehandle exec(@cmd); # run command. How to # capture @cmd errors gracefully? exit 9 # what is 9's special # meaning here? }; close($err); close($out); print P "test input to child" or die ("Mein Leiben! $!"); close(P) or die("Stella! $!");
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Forked pipe open...or do???
by Skeeve (Parson) on Sep 12, 2006 at 07:33 UTC | |
|
Re: Forked pipe open...or do???
by shmem (Chancellor) on Sep 12, 2006 at 09:44 UTC | |
|
Re: Forked pipe open...or do???
by sgifford (Prior) on Sep 12, 2006 at 15:45 UTC |