$tee = IO::Tee->new(\*STDOUT, \*OUTFILE); print $tee "Your data here" if .....