Prevent "uninitialized value" warnings in parameter logging
authorBill Erickson <berick@esilibrary.com>
Tue, 26 Jun 2012 13:21:57 +0000 (09:21 -0400)
committerGalen Charlton <gmc@esilibrary.com>
Fri, 18 Jan 2013 16:04:27 +0000 (11:04 -0500)
Use of uninitialized value $p[0] in join or string at
/usr/local/share/perl/5.10.1/OpenSRF/Application.pm line 130.

This is caused when the array of method params contains null/undef
values.  Prevent the warnings by replacing these values w/ empty
strings.

Signed-off-by: Bill Erickson <berick@esilibrary.com>
Signed-off-by: Dan Scott <dscott@laurentian.ca>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
src/perl/lib/OpenSRF/Application.pm

index 9283b7f..0a5c188 100644 (file)
@@ -146,7 +146,7 @@ sub handler {
                        if ($redact_params) {
                                $logdata .= "**PARAMS REDACTED**";
                        } else {
-                               $logdata .= join(', ',@p);
+                               $logdata .= join(', ', map { (defined $_) ? $_ : '' } @p);
                        }
                }
                $log->info($logdata);