Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: Redirect STDOUT to a $variable

by Moron (Curate)
on Aug 10, 2007 at 11:53 UTC ( #631770=note: print w/ replies, xml ) Need Help??


in reply to Redirect STDOUT to a $variable

It's not abundantly clear what is wanted although taking your first statement in isolation, I would deduce (tentatively!) that (on *NIX) you'd want something like:

prog.pl | tee trapit.txt
and then postprocess what landed in the siphoned-off text file.

On Windows there is no tee, so you'd have to overload the print function with your own routine to print both to STDOUT and somewhere else.

Update: BUT if you can live with the output being completely redirected rather than just copied then...

prog.pl > trapit.txt
works on Windows and *NIX
__________________________________________________________________________________

^M Free your mind!


Comment on Re: Redirect STDOUT to a $variable
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (4)
As of 2015-07-28 04:35 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (252 votes), past polls