Hello fellow Monks and Monkesses. I am attempting to use a child module of XML::Sablotron with mod_perl. When using it in mod_perl mode, I seem to be breaking DynaLoader, and get the error: Can't locate auto/XML/Sablotron/new.al in @INC (@INC contains: (etc...)) Due to the following code:
package My::Groovy::Module; use strict; use XML::Sablotron; use vars qw(@ISA, $VERSION); @ISA = qw(XML::Sablotron); ... sub new { my $proto = shift; my $class = ref($proto) || $proto; my $self = $class->SUPER::new(); ... }
The error occurs on the line where I call the super-class constructor. Oddly, this code works perfectly when running via normal Perl, but dies with that error when running via mod_perl. I have checked mod_perl's @INC and confirmed that the right directories are there, and have Dumper()ed %INC and seen that XML::Sablotron is indeed loaded. I have tried loading XML::Sablotron in my Apache startup file before my child module gets loaded, I have tried hardcoding the class name in my constructor, and a lot of other things I can't remember, all with the same result. The environment is perl 5.005_03 and mod_perl 1.25, running on FreeBSD. Any help would be greatly, greatly appreciated. Thanks. :)

In reply to DynaLoader errors with mod_perl by mfriedman

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.