[Bps-public-commit] r16375 - in Path-Dispatcher/trunk: lib/Path/Dispatcher

sartak at bestpractical.com sartak at bestpractical.com
Sun Oct 19 07:46:32 EDT 2008


Author: sartak
Date: Sun Oct 19 07:46:30 2008
New Revision: 16375

Modified:
   Path-Dispatcher/trunk/   (props changed)
   Path-Dispatcher/trunk/lib/Path/Dispatcher/Rule.pm

Log:
 r74155 at onn:  sartak | 2008-10-19 07:46:22 -0400
 Use the empty string for no leftover instead of undef


Modified: Path-Dispatcher/trunk/lib/Path/Dispatcher/Rule.pm
==============================================================================
--- Path-Dispatcher/trunk/lib/Path/Dispatcher/Rule.pm	(original)
+++ Path-Dispatcher/trunk/lib/Path/Dispatcher/Rule.pm	Sun Oct 19 07:46:30 2008
@@ -25,10 +25,10 @@
     my ($result, $leftover) = $self->_match($path);
     return unless $result;
 
-    undef $leftover if defined($leftover) && length($leftover) == 0;
+    $leftover = '' if !defined($leftover);
 
     # if we're not matching only a prefix then require the leftover to be empty
-    return if defined($leftover)
+    return if length($leftover)
            && !$self->prefix;
 
     # make sure that the returned values are PLAIN STRINGS
@@ -46,7 +46,7 @@
         path     => $path,
         rule     => $self,
         result   => $result,
-        defined($leftover) ? (leftover => $leftover) : (),
+        leftover => $leftover,
     );
 
     return $match;



More information about the Bps-public-commit mailing list