Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re: real time output

by hgolden (Pilgrim)
on Sep 11, 2006 at 21:25 UTC ( [id://572404]=note: print w/replies, xml ) Need Help??


in reply to real time output

Hey

I may be wrong, but I suspect the issue isn't the buffering (though you should try that too), but is instead that you aren't reading the output before the command finishes. Depending on what you're doing, you may be able to do a piped open on the command, and capture the output that way. That would go something like this:

open(COMMAND, "$cmd |"); while($out=<COMMAND>) { print "$out"; }
Check out more about Open at http://perldoc.perl.org/functions/open.html and let me know if you're having trouble.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others having a coffee break in the Monastery: (3)
As of 2025-05-24 22:34 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.