I'm working from the following example code using Apache 2.2.0 and Perl 5.8.7, and mod_perl 2.0.2 in a prefork configuration.
http://perl.apache.org/docs/2.0/user/config/custom.html#Examples

--- 8< --- package MyPackage; use Apache2::Module qw(); use Apache2::... a whole bunch more apache modules our @DIRECTIVES = qw(directive1 foo bar etc); Apache2::Module::add(__PACKAGE__, [ map { { name => $_ } } @DIRECTIVES + ]); . . . --- 8< ---

However I keep getting "Undefined subroutine &Apache2::Module::add called"

I've looked in the mod_perl2 source, and it definitely has references to that function. I don't have problems with any other core Apache2:: module - just this one. I'm pretty sure I've not typoed - I've checked it enough times.

What am I doing wrong?

Edit by holli: changed pre tags to code tags and links to []-notation.


In reply to Apache2::Module::add hiding from me by nicolaw

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.