- or download this
use IO::Tee;
my $tee = IO::Tee -> new(">stdout.txt", \*STDOUT);
print $tee "Cheese!\n";
- or download this
my $log = 0;
...
} else {
print "What did I want to say?\n"
}
- or download this
my $tee;
sub log_to_file {
...
close $logfile;
}
}
- or download this
sub log_to_file {
my $on = $_[0];
...
});
}
}