fixing _get_component_type_name
André Walker [Thu, 4 Aug 2011 23:41:12 +0000 (20:41 -0300)]
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;