package example::PerlResponseHandler; use strict; use warnings; use APR::OS (); use Apache2::Const -compile => qw(OK); our $obj; sub handler { my $r = shift; my $tid = APR::OS::current_thread_id(); if(!$obj) { $obj = {one => 1}; warn "[pid $$ tid $tid] New object generated"; } $r->content_type('text/html'); $r->print('mod_perl rules!' . $obj->{one}); return Apache2::Const::OK; } 1;