in reply to Using currently selected filehandle

Or do it the other way around, with a combination of yours and hardburn's methods. Name your sub to be 'printto' and then print to the filehand in the sub, like this:
my $fh = select; printto("Hello\n"); sub printto { my $string = shift; print $fh $string; }
Although it just seems like it'd be a lot either to just print it to the file hand directly as hardburn said.

Replies are listed 'Best First'.
Re: Re: Using currently selected filehandle
by sgifford (Prior) on Jun 23, 2003 at 18:22 UTC
    If you add a use strict to the top of that, it doesn't work.