1 package TestApp::View::Dump;
4 use base 'Catalyst::Base';
7 use Scalar::Util qw(weaken);
10 my ( $self, $reference ) = @_;
12 return unless $reference;
14 my $dumper = Data::Dumper->new( [$reference] );
19 $dumper->Quotekeys(0);
26 my ( $self, $c, $reference ) = @_;
28 # Force processing of on-demand data
31 # Remove context from reference if needed
32 my $context = delete $reference->{_context};
34 # Remove body from reference if needed
35 my $body = delete $reference->{_body};
38 $self->dump( $reference || $c->stash->{dump} || $c->stash ) )
41 $c->res->headers->content_type('text/plain');
42 $c->res->output($output);
45 $reference->{_context} = $context;
46 weaken( $reference->{_context} );
49 $reference->{_body} = $body;