X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=p5sagit%2FConfig-Any.git;a=blobdiff_plain;f=lib%2FConfig%2FAny%2FXML.pm;h=ee5be5c67a968332c683c615ea36a8e78b4f1a41;hp=46060c4b3e2cc4791f9e35291f37f108ca6d3ded;hb=d7eb7b5ca6dd18e740943079a1585661cec4d81f;hpb=c793253e5f2ad3ca9d60e96e07a5d87fa344ec31 diff --git a/lib/Config/Any/XML.pm b/lib/Config/Any/XML.pm index 46060c4..ee5be5c 100644 --- a/lib/Config/Any/XML.pm +++ b/lib/Config/Any/XML.pm @@ -57,14 +57,13 @@ sub load { } sub _coerce { - # coerce the XML-parsed config into the correct format 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; + my $name = ref $ref eq 'HASH' ? delete $ref->{ name } : undef; if ( defined $name ) { $out->{ $k }->{ $name } = $ref; } @@ -102,7 +101,7 @@ Joel Bernstein Erataxis@cpan.orgE =head1 COPYRIGHT AND LICENSE -Copyright 2006-2009 by Brian Cassidy +Copyright 2006-2011 by Brian Cassidy This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.