Not the greatest invention of mankind, nor even as handy as
IO::Tee probably, but this works pretty well for the amount
of typing and thought I put into it:
open my $foo, ">>bar" || die "Can't write to bar : $!\n";
sub print2 {
my $fh = shift;
print STDOUT "$_[0]";
print $fh "$_[0]";
}
### needs a comma, unlike print()
print2 $foo, "Hello, world!\n";
Still, IO::Tee is built for what you want to do.
As for your other questions, the probability that someone will learn from answers about them is higher if they are in their own thread. So, if you post those in their own node, they're also more likely to be answered. :-)