fixing _get_component_type_name
[catagits/Catalyst-Runtime.git] / lib / Catalyst / IOC / Container.pm
index c4c8b5a..0d39702 100644 (file)
@@ -667,7 +667,9 @@ sub _get_component_type_name {
 
     my @parts = split /::/, $component;
 
-    while (my $type = shift @parts) {
+    while (scalar @parts > 1) {
+        my $type = shift @parts;
+
         return ('controller', join '::', @parts)
             if $type =~ /^(c|controller)$/i;