- or download this
sub foo {
my $o = "";
...
} else {
print MYFILE foo();
}
- or download this
sub foo {
print "blah\n";
...
}
foo();
$OLDH and select $OLDH;
- or download this
sub foo {
my($O) = @_;
print $O "blah\n";
}
foo($to_file ? *MYFILE : *STDOUT);
- or download this
sub foo {
my($P) = @_;
...
}
foo($to_file ? sub { print MYFILE @_ } : sub { print @_ });
# or foo(sub { if ($to_file) { print MYFILE @_ } else { print @_ } });
- or download this
our $O;
sub foo {
...
sub pri {
if ($to_file) { print MYFILE @_ } else { print @_ }
}