in reply to Munging STDIN and STDOUT into one handle

You could tie a handle, providing a READ method that reads from STDIN and a PRINT method that writes to STDOUT.

That's about the simplest approach I can think of, especially if you subclass Tie::Handle.

  • Comment on Re: Munging STDIN and STDOUT into one handle