http://www.wetware.com/drieux/CS/lang/Perl/Beginners/p1_read_p2.txt
On Monday, April 1, 2002, at 02:49 , Roy Peters wrote:
> Hello,
>
> I have 2 independent perl programs p1 and p2. p1 calls p2 (using either
> the
> system() or `` operators, and p2 will print
> out status information every 2 seconds or so. How do I set it up such
> that whenever p2 prints out data, it is printed out by p1 also IN REAL
> TIME?
I don't think you can do it that way, but you might want to
remember that 'open' will also works like popen() in 'c', et al.
system is about 'execing' a sub process - and that is not
always easy to deal with getting it to open a pipe back to
the process that is waiting...
If p1 needs to process other requests, to which this p2 process
is actually supposed to be a forked child.... who needed to
open a pipe back... then you have to go open up the Net:: stuff....
ciao
drieux
---
and for the purists - in the above text we do a old school
'c' style while loop with chomp - and , ok, I confess, the
cooler perlie style
chomp, <doSomething>
while(<INPUT>) ;
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]