$app->{browser}->add_handler("response_done", sub { shift->dump; return }); #### ->SUPER::new( tokens => \%tokens, browser => WWW::Mechanize->new( autocheck => 0 ), ) #### my $response = eval { $app->view_restricted_resource ... }; unless( $response ){ warn "ERROR $@ "; $response = $app->res; # WWW::Mechanize cache it for you } print $response->content;