sub tee { my ($fhs, $strings) = @_; print {$_} @$strings for @$fhs; } open my $fh1, '>', $f1 or die "$f1: $!"; open my $fh2, '>', $f2 or die "$f2: $!"; tee([ $fh1, $fh2 ], [ 'Whatever you want to ', $print ]);