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.