johnnywang has asked for the wisdom of the Perl Monks concerning the following question:
(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:
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)package Foo; package Foo::Bar; use base 'Foo'; package Foo::Bar::Test; use base 'Foo::Bar'; 1;
Is there a way to find out what symbols/packages have been loaded before that failed call? I tried the following:
which in commandline produces:package Foo; package Foo::Bar; use base 'Foo'; print "$_ => $Foo::{$_}\n" foreach keys %Foo::;
but in mod_perl, it produces:Bar:: => *Foo::Bar:: VERSION => *Foo::VERSION Bar:: => *Foo::Bar:: isa => *Foo::isa VERSION => *Foo::VERSION
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)Bar:: => *Foo::Bar:: <br> VERSION => *Foo::VERSION <br>
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.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Packages and symbol tables
by Joost (Canon) on Dec 01, 2007 at 14:16 UTC | |
by johnnywang (Priest) on Dec 01, 2007 at 18:17 UTC | |
by Jenda (Abbot) on Dec 01, 2007 at 18:56 UTC | |
by Anonymous Monk on Dec 01, 2007 at 19:14 UTC |
Back to
Seekers of Perl Wisdom