Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re: Use of IPC::Run rather than system()

by Rex(Wrecks) (Curate)
on Jul 16, 2003 at 16:33 UTC ( #274915=note: print w/ replies, xml ) Need Help??


in reply to Use of IPC::Run rather than system()

From the description of system in the Camel:

"To capture output from a command, use backticks or qx// instead."

Update: I seem to have misread the question, the way I read it would have been a simple split operation an any output. Being ESL, it didn't sink in that the poster wanted to split up STDERR and STDOUT. My mistake, thanks fot the spanking :)

"Nothing is sure but death and taxes" I say combine the two and its death to all taxes!


Comment on Re: Use of IPC::Run rather than system()
Select or Download Code
Re^2: Use of IPC::Run rather than system()
by Aristotle (Chancellor) on Jul 16, 2003 at 16:42 UTC
    Except
    I would now like to additionally capture the STDOUT and STDERR of the external program in separate scalars within the Perl script.

    Makeshifts last the longest.

Re: Re: Use of IPC::Run rather than system()
by IlyaM (Parson) on Jul 16, 2003 at 16:50 UTC

      Thanks for that - note however that in addition to capturing STDOUT/STDERR, I still need to have the STDIN/STDOUT/STDERR of the external program connected to the terminal where the person is running the script, in case the external program requires input from the user, and so that any output is immediately visible to the user, in addition to being saved in the scalar(s).

      I'll try your recommendation out though - maybe it does give me what I want.

        For STDIN/-ERR, just print the output to the appropriate handles yourself. For STDIN, if you have taken control of the subprocesses STDIN yourself, just copy the user input in there yourself. You can do that "realtime" rather than post mortem by passing closures rather scalar refs, if memory serves.

        Makeshifts last the longest.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (3)
As of 2014-09-24 04:05 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (245 votes), past polls