1 May
2014
1 May
'14
1:02 a.m.
On April 30, 2014 11:24:32 AM Brian Brandes wrote:
get '/buffertest' => sub { my $r = request->input_handle; $r->print("hello world"); # ref $r == Apache2::RequestRec return; };
If all you are doing with the $r object is printing, maybe a little wrapper could do the trick: sub capture_output(&) { open my $handle, '>', \my $output; $_[0]->($handle); return $output; } get '/' => sub { return capture_output { my $r = shift; $r->print( "hello there!"); } }; Joy, `/anick