in reply to Troubleshooting perl runtime errors
This shows the type of error you are getting:
$e = sprintf( '%s', undef );; Use of uninitialized value in sprintf at (eval 28) line 1, <STDIN> lin +e 20.
And this shows how to trap that error, get access to its text (as the first argument to the $SIG{__WARN__} pseudo-signal handler routine):
eval{ local $SIG{__WARN__} = sub{ printf STDERR "Warning detected: %s", $_[0]; }; $e = sprintf( '%s', undef ); };; Warning detected: Use of uninitialized value in sprintf at (eval 29) l +ine 1, <STDIN> line 21.
Substitute your log file handle for STDERR; and decorate or modify the output as you see fit.
See perlvar (search for "__WARN__") for more information.
|
---|