Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: Running and Monitoring program output

by jweed (Chaplain)
on Feb 20, 2004 at 17:17 UTC ( [id://330610]=note: print w/replies, xml ) Need Help??


in reply to Running and Monitoring program output

Well, I think your best bet would be to use the forking open.

Here's how you might do that (this is straight from Cookbook 16.10):
use IO::Handle; if ($pid = open $child, "-|") { while (<$child>) { #look ma! I'm processing! } close $child; } else { die "Couldn't fork: $!" unless defined $pid; STDOUT->autoflush(1); #exec program that wrties to STDOUT exit; }



Code is (almost) always untested.
http://www.justicepoetic.net/

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://330610]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others goofing around in the Monastery: (4)
As of 2024-04-25 22:46 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found