X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FCatalyst%2FDispatchType%2FPath.pm;h=ccff553d4a74ee0423bd9c4bd7a910471c29b8b9;hb=694d15f1f6031de10d1ecb047b9e66dd0982e3a3;hp=cffe66b4f591d85db281335aabce6ebdb268404a;hpb=081def36ee509794aa7b30768c699b16636cee33;p=catagits%2FCatalyst-Runtime.git diff --git a/lib/Catalyst/DispatchType/Path.pm b/lib/Catalyst/DispatchType/Path.pm index cffe66b..ccff553 100644 --- a/lib/Catalyst/DispatchType/Path.pm +++ b/lib/Catalyst/DispatchType/Path.pm @@ -62,7 +62,7 @@ sub register { my @register; foreach my $r ( @{ $attrs->{Path} || [] } ) { - unless ( $r ) { + unless ($r) { $r = $action->namespace; } elsif ( $r !~ m!^/! ) { # It's a relative path @@ -81,7 +81,9 @@ sub register { # Register sub name as a relative path } - $self->register_path($c, $_, $action) for @register; + $self->register_path( $c, $_, $action ) for @register; + return 1 if @register; + return 0; } =item $self->register_path($c, $path, $action) @@ -89,7 +91,7 @@ sub register { =cut sub register_path { - my ($self, $c, $path, $action) = @_; + my ( $self, $c, $path, $action ) = @_; $path =~ s!^/!!; $self->{paths}{$path} = $action; }