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

Re^2: Tie *STDOUT, recursion error

by Superfox il Volpone (Sexton)
on Apr 11, 2015 at 20:37 UTC ( [id://1123154]=note: print w/replies, xml ) Need Help??


in reply to Re: Tie *STDOUT, recursion error
in thread Tie *STDOUT, recursion error

thanks for the reply. I was looking to the source code of Tie::STDOUT. He basically solves it with something like:
open(my $stdout, ">&", STDOUT); ... # in the overloaded method PRINT $stdout->print( @_ ); # this refers to the original STDOUT.
I guess this opens a different underlying file handle, while my $oldhandle = STDOUT is an assignment/alias to the same file handle used by STDOUT.

s.fox

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others musing on the Monastery: (4)
As of 2024-09-18 13:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    The PerlMonks site front end has:





    Results (24 votes). Check out past polls.

    Notices?
    erzuuli‥ 🛈The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.