if you wrap this code into a subroutine, and have a global array of filehandles you wouldn't have to loop through the handles manually, this was just a showing-the-concept.
I'd become something like:
<open filehandles here ...>
my @global_filehandles = qw(STDOUT STDERR FILE);
printh("look mom, printed to 3 filehandles!\n");
sub printh {
my $text = shift;
foreach my $fh (@global_filehandles) {
no strict 'refs';
print $fh $text;
use strict;
}
}