Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re: Printing both to console and File

by soonix (Canon)
on Apr 17, 2017 at 12:49 UTC ( [id://1188131]=note: print w/replies, xml ) Need Help??


in reply to Printing both to console and File

The problem is that IO::Tee->new gives you a new handle, and your select call only changes the default file handle of print from STDOUT to the new handle.

It seems to me, that wrapping your code into Capture::Tiny->tee (which internally uses IO::TeeHandle) would solve your problem.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others imbibing at the Monastery: (7)
As of 2024-04-24 10:45 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found