Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Answer: Redirecting all output to a var for post processing?

( #58234=categorized answer: print w/ replies, xml ) Need Help??

Q&A > input and output > Redirecting all output to a var for post processing? contributed by goldclaw

If collecting all output in the same variable is OK for you, then using Tie::STDERR would do the job:
use vars qw($OUTPUT); use Tie::STDERR \$OUTPUT; *STDOUT=\*STDERR;
You might want to save the value of STDOUT if you would like to print something after you are done filtering etc.

goldclaw

Comment on Answer: Redirecting all output to a var for post processing?
Download Code
Log In?
Username:
Password:

What's my password?
Create A New User
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (7)
As of 2016-02-12 11:01 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How many photographs, souvenirs, artworks, trophies or other decorative objects are displayed in your home?





    Results (395 votes), past polls