in reply to (tye)Re: redirecting STDOUT (of a system call) to a var
in thread redirecting STDOUT (of a system call) to a var
now i call waitpid(-1,0), and the value of $? is the return value from the open! this will make my programming life MUCH easier!
thank you tye.
in case this helps anyone else, the code that's changed is:
i am amazed. and VERY happy.eval { $pid = open3("<&STDIN", \*OUTPUT, \*OUTERR, 'perl return.pl') ; $val = waitpid(-1,0); # <--- added this line }; ... print "---pid$n"; print $pid . $n; # <--- prints pid print "---val$n"; print $val . $n; # <--- prints pid print "---\$?$n"; print $? >>8, $n; # <--- prints exit val
~Particle
|
|---|