perltidy
[p5sagit/Config-Any.git] / lib / Config / Any / XML.pm
index d5221c5..a5fc881 100644 (file)
@@ -45,27 +45,29 @@ sub load {
     my $args  = shift || {};
 
     require XML::Simple;
-    my $config = XML::Simple::XMLin( 
-        $file, 
+    my $config = XML::Simple::XMLin(
+        $file,
         ForceArray => [ qw( component model view controller ) ],
         %$args
     );
 
-    return $class->_coerce($config);
+    return $class->_coerce( $config );
 }
 
 sub _coerce {
+
     # coerce the XML-parsed config into the correct format
-    my $class = shift;
+    my $class  = shift;
     my $config = shift;
     my $out;
-    for my $k (keys %$config) {
-        my $ref = $config->{$k};
-        my $name = ref $ref ? delete $ref->{name} : undef;
-        if (defined $name) {
-            $out->{$k}->{$name} = $ref; 
-        } else {
-            $out->{$k} = $ref;
+    for my $k ( keys %$config ) {
+        my $ref = $config->{ $k };
+        my $name = ref $ref ? delete $ref->{ name } : undef;
+        if ( defined $name ) {
+            $out->{ $k }->{ $name } = $ref;
+        }
+        else {
+            $out->{ $k } = $ref;
         }
     }
     $out;