X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FMooseX%2FStorage%2FUtil.pm;fp=lib%2FMooseX%2FStorage%2FUtil.pm;h=e11b33c3e06ed25654d9d01299434e3d9c907117;hb=207b646bb9f1f7778bb8b5d7564bf277581c5a0e;hp=fdfbf9631d69f696497578e62a1e4d56a6df9cc7;hpb=1e1598d05052f71b0af1451107c352610306471c;p=gitmo%2FMooseX-Storage.git diff --git a/lib/MooseX/Storage/Util.pm b/lib/MooseX/Storage/Util.pm index fdfbf96..e11b33c 100644 --- a/lib/MooseX/Storage/Util.pm +++ b/lib/MooseX/Storage/Util.pm @@ -64,6 +64,20 @@ sub _inflate_yaml { return $data; } +sub _inflate_xml { + my ($class, $xml) = @_; + + eval { require XML::Simple; XML::Simple->import }; + confess "Could not load XML::Simple module because : $@" if $@; + + my $data = eval { XMLin($xml, SuppressEmpty => 1) }; + if ($@) { + confess "There was an error when attempting to peek at XML: $@"; + } + + return $data; +} + 1; __END__