From: Brian Cassidy Date: Thu, 23 Aug 2007 13:32:05 +0000 (+0000) Subject: minor cleanup -- pass args to XML::Simple X-Git-Tag: v0.08~4 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=7d9d28036aaa111bf0c346bc061fae6032be3422;p=p5sagit%2FConfig-Any.git minor cleanup -- pass args to XML::Simple --- diff --git a/lib/Config/Any/JSON.pm b/lib/Config/Any/JSON.pm index 954e305..922bb61 100644 --- a/lib/Config/Any/JSON.pm +++ b/lib/Config/Any/JSON.pm @@ -50,8 +50,7 @@ sub load { eval { require JSON::Syck; }; if( $@ ) { require JSON; - JSON->import; - return jsonToObj( $content ); + return JSON::jsonToObj( $content ); } else { return JSON::Syck::Load( $content ); diff --git a/lib/Config/Any/XML.pm b/lib/Config/Any/XML.pm index 4660338..d5221c5 100644 --- a/lib/Config/Any/XML.pm +++ b/lib/Config/Any/XML.pm @@ -42,12 +42,13 @@ Attempts to load C<$file> as an XML file. sub load { my $class = shift; my $file = shift; + my $args = shift || {}; require XML::Simple; - XML::Simple->import; - my $config = XMLin( + my $config = XML::Simple::XMLin( $file, ForceArray => [ qw( component model view controller ) ], + %$args ); return $class->_coerce($config);