in reply to importing functions with "PerlModule" Apache directive

This is really not what PerlModule is for, but depending on how your script is structured, it should be doable.

Find your modules directory - something like:

/usr/lib/perl5/site_perl/5.14.2 (or whatever Perl version you're using)

And then create a file called ApacheAutoload.pm. In that file, include:

package main; # this is important use DBI; use CGI qw(:cgi -compile -utf8); # ... and so on

Then in your Apache config file, do this:

PerlModule ApacheAutoload
perl -E'sub Monkey::do{say$_,for@_,do{($monkey=[caller(0)]->[3])=~s{::}{ }and$monkey}}"Monkey say"->Monkey::do'

Replies are listed 'Best First'.
Re^2: importing functions with "PerlModule" Apache directive
by Anonymous Monk on May 09, 2012 at 14:38 UTC
    package main; # this is important
    important to add to any Registry scripts as well :) otherwise __PACKAGE__ is ModPerl::ROOT::ModPerl::Registry::_path_to_file
Re^2: importing functions with "PerlModule" Apache directive
by acanfora (Novice) on May 09, 2012 at 14:38 UTC
    In your opinion is it more cleaner to use this method or the PerlPostConfigRequire directive?

      I'd be wanting to take a long, hot shower after either method.

      perl -E'sub Monkey::do{say$_,for@_,do{($monkey=[caller(0)]->[3])=~s{::}{ }and$monkey}}"Monkey say"->Monkey::do'
        Got it :) I'll throw away all the stuff in apache.conf except PerlTaintCheck On and stick with use whatever in every script :) Thank you very much for advices.