X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FCatalyst.pm;h=37371ab0001ef2a6c1374661e1c7729ec0842d5e;hb=2af0c5847de5fa789e09f50ceb2b54aaebd6913e;hp=1a8990a885bb792543d618d83b21ccfd7c160f77;hpb=81acce7179c17468e653f4e07e4b552dd106f5f4;p=catagits%2FCatalyst-Runtime.git diff --git a/lib/Catalyst.pm b/lib/Catalyst.pm index 1a8990a..37371ab 100644 --- a/lib/Catalyst.pm +++ b/lib/Catalyst.pm @@ -718,10 +718,7 @@ sub component { my ( $c, $component, @args ) = @_; return sort keys %{ $c->components } - unless ( $component ); - - return $c->_find_component( $component, @args ) - if ref $component; + unless $component; my ($type, $name) = _get_component_type_name($component); @@ -730,6 +727,11 @@ sub component { ) if $type; my @result = $c->_find_component( $component, @args ); + + # list context for regexp searches + return @result if ref $component; + + # only one component (if it's found) for string searches return shift @result if @result; # FIXME: I probably shouldn't be doing this