Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re^2: How to cpture output of interactive command using perl.?

by xdg (Monsignor)
on Dec 10, 2008 at 15:16 UTC ( [id://729436]=note: print w/replies, xml ) Need Help??


in reply to Re: How to cpture output of interactive command using perl.?
in thread How to cpture output of interactive command using perl.?

On Unix-like systems...

For a portable, pure-perl approach, there is the Tee module.

use Tee; use File::Temp qw(tempfile); my ($fh, $filename) = tempfile(); close $fh; tee("your_command", $filename);

-xdg

Code written by xdg and posted on PerlMonks is public domain. It is provided as is with no warranties, express or implied, of any kind. Posted code may not have been tested. Use of posted code is at your own risk.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (3)
As of 2024-04-19 19:42 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found