in reply to Piping sockets to STDIN

If you use the one-argument form of select, you can change the default output filehandle. You might also look at IO::Handle or its children and always pass in a filehandle and print to that.