(This is a continuation of XML::Generator problem in mod_perl, now I got rid of all the none relevant info)

I have a module Foo.pm:

package Foo; package Foo::Bar; use base 'Foo'; package Foo::Bar::Test; use base 'Foo::Bar'; 1;
My problem is that the above module loads ok in command line perl, but it fails in mod_perl (failed on the last "use base 'Foo::Bar'", it can't find the class Foo::Bar)

Is there a way to find out what symbols/packages have been loaded before that failed call? I tried the following:

package Foo; package Foo::Bar; use base 'Foo'; print "$_ => $Foo::{$_}\n" foreach keys %Foo::;
which in commandline produces:
Bar:: => *Foo::Bar:: VERSION => *Foo::VERSION Bar:: => *Foo::Bar:: isa => *Foo::isa VERSION => *Foo::VERSION
but in mod_perl, it produces:
Bar:: => *Foo::Bar:: <br> VERSION => *Foo::VERSION <br>
I guess my question is whether this is the right way to see whether the "Foo::Bar" package is loaded, and why mod_perl behaves differently? (perl 5.8.0, mod_perl 1.29, apache1.3.3)

In my real situation, the package is XML::Generator. To complicate the things further, I have another "identical" installation of perl/mod_perl/apache, where this works ok. I guess I'm trying to find out how to figure out what the difference is.


In reply to Packages and symbol tables by johnnywang

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.