sub handler { my $r = shift; my $my_r = My::Apache::Request->new($r); # do interesting things with $my_r } #### # somewhere in your code... my $r = My::Apache::Request->instance; # in My::Apache::Request; package My::Apache::Request; use base qw(Apache::Singleton); # or something like it sub _new_instance { my $class = shift; return $class->new(r => Apache::Request->instance); }