sub mprint { my @fh; push(@fh, shift) while (ref($_[0]) eq 'GLOB'); print $_ @_ foreach (@fh); } open($so, ">&STDOUT"); open($se, ">&STDERR"); mprint $se, $so, "This tests\n";