X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FCatalyst%2FAction%2FSerialize%2FXML%2FSimple.pm;h=e11f267979fd7e42170244cd92f25d8628638390;hb=8004a60b5d676a98f1a9d5cb1ad6a63ac6402617;hp=f91da2efa94407eebc2fa6fc807f26754243ef54;hpb=10bcd217c37d68aabbb0db8a5a7e233e679cb945;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 f91da2e..e11f267 100644 --- a/lib/Catalyst/Action/Serialize/XML/Simple.pm +++ b/lib/Catalyst/Action/Serialize/XML/Simple.pm @@ -1,9 +1,12 @@ package Catalyst::Action::Serialize::XML::Simple; -use strict; -use warnings; +use Moose; +use namespace::autoclean; -use base 'Catalyst::Action'; +extends 'Catalyst::Action'; + +our $VERSION = '1.00'; +$VERSION = eval $VERSION; sub execute { my $self = shift; @@ -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;