Help for this page
sub tee_print { print MYLOGFILE $_[0]; print $_[0] } eval { ... $h->method($params) or tee_print("oops: " . $h->errstr()); }; if ($@) { tee_print("error: $@") }
my $h = MyModule->new(PrintHandler => \&tee_print, WarnHandler => \&tee_print, ErrMode => 'return'); $h->method($params) or tee_print("oops: " . $h->errstr());