use File::Tee qw(tee); tee(STDOUT, '>', $outfile) or die ...; [download]
In reply to Re: "tee"ing my own stdout/stderr by salva in thread "tee"ing my own stdout/stderr by conrad