X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FCatalyst%2FDispatchType%2FRegex.pm;h=0d639b1a3b666f5e24c7a5d7d29c8e4377e0fe43;hb=22f3a8dd32e5940d87a1d21642fa39c7813bc921;hp=8f99f75ef44609209c604dd47f694f0e30f804ae;hpb=6b23994966a2a66b90986a51e7e1d71f62d90f44;p=catagits%2FCatalyst-Runtime.git diff --git a/lib/Catalyst/DispatchType/Regex.pm b/lib/Catalyst/DispatchType/Regex.pm index 8f99f75..0d639b1 100644 --- a/lib/Catalyst/DispatchType/Regex.pm +++ b/lib/Catalyst/DispatchType/Regex.pm @@ -7,6 +7,7 @@ sub prepare_action { my ($self, $c, $path) = @_; return if $self->SUPER::prepare_action($c, $path); + # Check path against plain text first foreach my $compiled (@{$self->{compiled}||[]}) { if ( my @snippets = ( $path =~ $compiled->{re} ) ) { @@ -27,8 +28,8 @@ sub register_action { my $attrs = $action->attributes; my @register = map { @{$_ || []} } @{$attrs}{'Regex', 'Regexp'}; foreach my $r (@register) { - $self->{paths}{$r} = $action; - push(@{$self->{compiled}}, + $self->{paths}{$r} = $action; # Register path for superclass + push(@{$self->{compiled}}, # and compiled regex for us { re => qr#$r#, action => $action,