It looks like you've revealed my evil action :) But, it seems like your method will also need hardcoding at least in two places. I'm currently using PerlSetVar to set the location:
<Location /foo> SetHandler perl-script PerlSetVar NAME "/foo" PerlHandler My::Apache::Handler </Location>
It looks like Apache2::Directive may help, but I still need to know what the location is:
use Apache2::Directive (); my $tree = Apache2::Directive::conftree(); my $node = $tree->lookup('Location', '/foo/');

In reply to Re^2: How to get the value of <Location> directive (mod_perl)? by Burak
in thread How to get the value of <Location> directive (mod_perl)? by Burak

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":