I’ll sometimes use the following code at the beginning of a script to
log errors while testing:
BEGIN {
use CGI::Carp qw(carpout);
open(_STDERR,'>&STDERR'); close STDERR;
open (my $log, '>>', 'logs/error.log') or warn("Couldn't open
error.log: $! \n");
car
> On Mar 25, 2017, at 8:51 AM, SSC_perl wrote:
>
> I’ll sometimes use the following code at the beginning of a script to
> log errors while testing:
>
> BEGIN {
> use CGI::Carp qw(carpout);
> open(_STDERR,'>&STDERR'); close STDERR;
> open (my $log, '>>', 'logs/error.log