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

Re: Script outputs on screen

by oiskuu (Hermit)
on Oct 24, 2013 at 17:52 UTC ( #1059526=note: print w/replies, xml ) Need Help??


in reply to Script outputs on screen

The `` slurps all output before it returns. Read from a file handle instead.
open( my $fh, '-|', "script2 a b c" ) or die; while (<$fh>) { print; }

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1059526]
help
Chatterbox?
[Corion]: Nicholas Clark++ # read for a multichar block-delimiter by scanning for the last char, and only then check whether the whole delimiter was read.
[Corion]: At least if you're appending the data read to a larger buffer, this means you avoid the situation of "a delimiter was found but the other half has not been read yet"
choroba misses the context

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (10)
As of 2016-12-06 14:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    On a regular basis, I'm most likely to spy upon:













    Results (107 votes). Check out past polls.