X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FCatalyst%2FAction%2FSerialize%2FXML%2FSimple.pm;h=173d958508e3ee2e8ba9a4e07b082ec20ebd3fcf;hb=7566d72f425ab3a870f1d6c8945c43f4edeedf2a;hp=a56207859622847acfe94d3d416973ab252c199a;hpb=930013e6f19b25a090c3f8839495ad8d9b15ff6d;p=catagits%2FCatalyst-Action-REST.git diff --git a/lib/Catalyst/Action/Serialize/XML/Simple.pm b/lib/Catalyst/Action/Serialize/XML/Simple.pm index a562078..173d958 100644 --- a/lib/Catalyst/Action/Serialize/XML/Simple.pm +++ b/lib/Catalyst/Action/Serialize/XML/Simple.pm @@ -5,6 +5,9 @@ use namespace::autoclean; extends 'Catalyst::Action'; +our $VERSION = '1.13'; +$VERSION = eval $VERSION; + sub execute { my $self = shift; my ( $controller, $c ) = @_; @@ -15,7 +18,7 @@ sub execute { if ($@) { $c->log->debug("Could not load XML::Serializer, refusing to serialize: $@") if $c->debug; - return 0; + return; } my $xs = XML::Simple->new(ForceArray => 0,); @@ -24,15 +27,11 @@ sub execute { $controller->{'serialize'}->{'stash_key'} : $controller->{'stash_key'} ) || 'rest'; - my $output; - eval { - $output = $xs->XMLout({ data => $c->stash->{$stash_key} }); - }; - if ($@) { - return $@; - } + my $output = $xs->XMLout({ data => $c->stash->{$stash_key} }); $c->response->output( $output ); return 1; } +__PACKAGE__->meta->make_immutable; + 1;