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

sartak at bestpractical.com sartak at bestpractical.com
Tue Feb 10 21:02:09 EST 2009


Author: sartak
Date: Tue Feb 10 21:02:09 2009
New Revision: 18335

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

Log:
 r79903 at onn:  sartak | 2009-02-10 21:02:05 -0500
 No need to futz with @- and @+, since a regex match in list context returns $1, $2, ...


Modified: Path-Dispatcher/trunk/lib/Path/Dispatcher/Rule/Regex.pm
==============================================================================
--- Path-Dispatcher/trunk/lib/Path/Dispatcher/Rule/Regex.pm	(original)
+++ Path-Dispatcher/trunk/lib/Path/Dispatcher/Rule/Regex.pm	Tue Feb 10 21:02:09 2009
@@ -12,9 +12,7 @@
     my $self = shift;
     my $path = shift;
 
-    return unless $path->path =~ $self->regex;
-
-    my @matches = map { substr($path->path, $-[$_], $+[$_] - $-[$_]) } 1 .. $#-;
+    return unless my @matches = $path->path =~ $self->regex;
 
     # if $' is in the program at all, then it slows down every single regex
     # we only want to include it if we have to



More information about the Bps-public-commit mailing list