in reply to Changing the name of STDOUT...
Inside that function, check for a $debug flag. If set, select STDOUT. Otherwise, select MAILPIPE.
You'll probably want to select STDOUT again after you're done, so you might have a generic printing method that combines the options.
Barring that, I'd recommend tilly's solution of a debugging module written to the same API. Why dup a filehandle when there are other options available that use less typing?
|
|---|