Given the following handler (straight from https://metacpan.org/pod/Plack::Handler::Apache2)
package My::ModPerl::Handler;
use Plack::Handler::Apache2;
sub get_app {
# magic!
}
sub handler {
my $r = shift; # Apache2::RequestRec
my $app = get_app(); # CODE
#-- #(1)
Plack::Handler::Apache2->call_app($r, $app);
#-- #(2)
}
and with the app
being a black box, is there a way to somehow retrieve
the complete response that was generated? I would like to do it in the
line marked with #(2)
and get both the headers and the body. Ideally,
I would do something magical in line #(1)
and somehow force $r
to
store the response (and then retrieve it in #(2)
).