Added the supplied argument to the regexp fallback warning for easier debugging
[catagits/Catalyst-Runtime.git] / lib / Catalyst.pm
index c84253d..ff5b3cd 100644 (file)
@@ -454,8 +454,14 @@ sub _comp_search_prefixes {
     $query  = qr/$name/i;
     @result = map { $c->components->{ $_ } } grep { $eligible{ $_ } =~ m{$query} } keys %eligible;
 
+    # no results? try against full names
+    if( !@result ) {
+        @result = map { $c->components->{ $_ } } grep { m{$query} } keys %eligible;
+    }
+
     # don't warn if we didn't find any results, it just might not exist
     if( @result ) {
+        $c->log->warn( qq(Found results for "${name}" using regexp fallback.) );
         $c->log->warn( 'Relying on the regexp fallback behavior for component resolution is unreliable and unsafe.' );
         $c->log->warn( 'If you really want to search, pass in a regexp as the argument.' );
     }