I am not able to find out if there is a way to pass to PerlModule directive the functions and/or parameters

PerlModule site:perl.apache.org -> http://perl.apache.org/docs/2.0/user/config/config.html#C_PerlModule_

PerlModule Foo::Bar
is equivalent to Perl's:
require Foo::Bar;
PerlModule is used to load modules using their package names.

See also: PerlRequire.

http://perl.apache.org/docs/2.0/user/config/config.html#C_PerlRequire_

PerlRequire does the same thing as PerlPostConfigRequire, but you have almost no control of when this code is going to be executed. Therefore you should be using either PerlConfigRequire (executes immediately) or PerlPostConfigRequire (executes just before the end of the server startup) instead. Most of the time you want to use the latter.

http://perl.apache.org/docs/2.0/user/config/config.html#C_PerlPostConfigRequire_

PerlPostConfigRequire /home/httpd/perl/lib/startup.pl
is equivalent to Perl's:
require "/home/httpd/perl/lib/startup.pl";

Looking at my current apache2/mod_perl2 config, I see I'm using

PerlRequire "...startup.pl"
just as http://perl.apache.org/docs/1.0/guide/config.html#PerlModule_and_PerlRequire_Directives recommends. This is not ideal for apache2 as http://perl.apache.org/docs/2.0/user/handlers/server.html#When_Does_perl_Start_To_Run explains.

Use  PerlRequire   "...startup.pl" for Apache1/mod_perl-1

Use  PerlPostConfigRequire "...startup.pl" for Apache2/mod_perl-2


In reply to Re: importing functions with "PerlModule" Apache directive by Anonymous Monk
in thread importing functions with "PerlModule" Apache directive by acanfora

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



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.