Catalyst-Engine-Apache

 view release on metacpan or  search on metacpan

t/lib/TestApp/View/Dump.pm  view on Meta::CPAN

package TestApp::View::Dump;

use strict;
use base 'Catalyst::View';

use Data::Dumper ();
use Scalar::Util qw(blessed weaken);

sub dump {
    my ( $self, $reference ) = @_;

    return unless $reference;

    my $dumper = Data::Dumper->new( [$reference] );
    $dumper->Indent(1);
    $dumper->Purity(1);
    $dumper->Useqq(0);

t/lib/TestApp/View/Dump.pm  view on Meta::CPAN

    if ( my $output =
        $self->dump( $reference ) )
    {

        $c->res->headers->content_type('text/plain');
        $c->res->output($output);

        if ($context) {
            # Repair context
            $reference->{_context} = $context;
            weaken( $reference->{_context} );
        }

        if ($body) {
            # Repair body
            delete $reference->{__body_type};
            $reference->{_body} = $body;
        }

        return 1;
    }



( run in 0.425 second using v1.01-cache-2.11-cpan-709fd43a63f )