Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: Best Way to Redirect STDERR to a Scalar

by mandog (Curate)
on Sep 13, 2003 at 22:44 UTC ( #291305=note: print w/ replies, xml ) Need Help??


in reply to Best Way to Redirect STDERR to a Scalar

I know you are using Perl 5.6.1 but if you were using Perl 5.8...

perldoc -f open #(snip) File handles can be opened to "in memory" files held in Perl scalars via: open($fh, '>', \$variable) or die "$!"; Though if you try to re-open "STDOUT" or "STDERR" as an "in memory" file, you have to close it first: close STDOUT; open STDOUT, '>', \$variable or die "Can't open STDOUT: $!";


email: mandog


Comment on Re: Best Way to Redirect STDERR to a Scalar
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (12)
As of 2014-10-22 07:00 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    For retirement, I am banking on:










    Results (114 votes), past polls