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

sartak at bestpractical.com sartak at bestpractical.com
Mon Aug 25 21:19:56 EDT 2008


Author: sartak
Date: Mon Aug 25 21:19:55 2008
New Revision: 15460

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

Log:
 r70343 at onn:  sartak | 2008-08-25 21:19:34 -0400
 Here shall go the ugly match logic


Modified: Path-Dispatcher/trunk/lib/Path/Dispatcher/Dispatch.pm
==============================================================================
--- Path-Dispatcher/trunk/lib/Path/Dispatcher/Dispatch.pm	(original)
+++ Path-Dispatcher/trunk/lib/Path/Dispatcher/Dispatch.pm	Mon Aug 25 21:19:55 2008
@@ -50,16 +50,18 @@
 sub run {
     my $self = shift;
     my @args = @_;
+    my @matches = $self->matches;
 
     eval {
         local $SIG{__DIE__} = 'DEFAULT';
-        for my $match ($self->matches) {
+        while (my $match = shift @matches) {
             eval {
-                local $SIG{__DIE__} = 'DEFAULT';
                 $match->run(@args);
 
-                no warnings 'exiting';
-                last if $match->ends_dispatch($self);
+                if ($match->ends_dispatch($self)) {
+                    no warnings 'exiting';
+                    last;
+                }
             };
             die $@ if $@ && $@ !~ /^Path::Dispatcher next rule\n/;
         }



More information about the Bps-public-commit mailing list