Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery

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?

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

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (2)
As of 2015-11-28 07:40 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (739 votes), past polls