Hi,

I have a script which executes under Apache::Registry and resides in
/perl/blah.pl.  However, it only generates a fragment of a page, and is
normally embedded into an html template using SSI with something like:

<!--#perl sub="Apache::Include" arg="/perl/blah.pl" -->

I am very aware that this would be better implemented as a raw perl module
used from apache's startup.pl (and then embedded using something like
<!--#perl sub="Blah" -->) - but practically this isn't an option right
now.

My problem is that I would like to nonetheless execute this code from
'normal' mod_perl; from a library used from startup.pl.  I've tried doing
this two ways to date, both of which have failed painfully:

1) Apache::Include->virtual("/perl/blah.pl");

Which simply segfaults the httpd process - presumably because the perl
interpreter which tries to handle the Included request collides with the
one actually executing the original script.

2) Apache::ROOTwww_2edomain_2ecom::perl::blah_2epl();

Which fails with the above being an Undefined subroutine.  Now, running
this with apache in non-forking mode as httpd -X and
$Apache::Registry::Debug = 4, I first request the URL of /perl/blah.pl to
make sure that Apache::Registry has compiled and cached the script:

[Fri Nov 15 19:58:13 2002] [error] Apache::Registry::handler for
/www01/domain.com/perl/blah.pl in process 31030
[Fri Nov 15 19:58:13 2002] [error] Apache::Registry::handler examining
/perl/blah.pl
[Fri Nov 15 19:58:13 2002] [error] Apache::Registry::handler package
Apache::ROOTwww_2edomain_2ecom::perl::blah_2epl

And see that it seems to compile and cache the script fine, with the
expected name, and indeeds generates the output to the browser correctly.

However, on then requesting a different Apache::Registry script which
makes use of the library preloaded in startup.pl which attempts to execute
Apache::ROOTwww_2edomain_2ecom::perl::blah_2epl(), it still dies on
failing to find that subroutine.

Any insight into how I might persuade this to work (without doing the
Right Thing and shifting everything into preloaded libraries (and perhaps
handlers)) would be appreciated.

This is all happening under Apache/1.3.27 mod_perl/1.27, with
Apache::Registry version 2.01 running on debian woody x86.

thanks,

Matthew.

Reply via email to