in reply to Re: Using currently selected filehandle
in thread Using currently selected filehandle

printto is a fairly complex 30-line sub which prints to a filehandle. To use print's default behavior, I would have to duplicate that entire sub, changing print $fh ... to just print .... I want to avoid doing that; it would require any changes to the output routines to happen identically in both places to avoid inconsistency, and my experience is that this is error-prone.

Of course, if anybody has suggestions for another way to do this, I'm all ears!

Replies are listed 'Best First'.
Re^3: Using currently selected filehandle
by particle (Vicar) on Jun 23, 2003 at 18:23 UTC

    why not have your print method take an optional filehandle?

    ~Particle *accelerates*