Subject: | Patch to prevent warnings in Dispatcher.pm |
Since revision 7714
<http://dev.catalystframework.org/svnweb/Catalyst/revision?rev=7714>,
Catalyst::Runtime::Dispatcher is missing a simple check in line 287 and
thus throws warnings with every request:
Use of uninitialized value in length at
/usr/local/libdata/perl5/site_perl/Catalyst/Dispatcher.pm line 287.
The attached patch should be self-explanatory.
Regards,
Simon
Subject: | Catalyst-Runtime-Dispatcher.diff |
Index: Dispatcher.pm
===================================================================
--- Dispatcher.pm (revision 7762)
+++ Dispatcher.pm (working copy)
@@ -285,7 +285,7 @@
s/%([0-9A-Fa-f]{2})/chr(hex($1))/eg for grep { defined } @{$c->req->captures||[]};
$c->log->debug( 'Path is "' . $c->req->match . '"' )
- if ( $c->debug && length $c->req->match );
+ if ( $c->debug && $c->req->match && length $c->req->match );
$c->log->debug( 'Arguments are "' . join( '/', @args ) . '"' )
if ( $c->debug && @args );