|laziness, impatience, and hubris|
Single module spanning multiple Packages,by prhodes (Novice)
|on Feb 08, 2013 at 13:03 UTC||Need Help??|
prhodes has asked for the
wisdom of the Perl Monks concerning the following question:
I have one script, two packages, and a module. Let's call them script.pl, pkga.pm, pkgb.pm, and common.pm
I have alot of code, but I've stripped out as much content as possible in order to make my question simple and non-ambiguous.
Both pkga.pm and pkgb.pm are packages in their own right (in fact they are OO packages containing methods), and start with the Package keyword in order to define them as such.
This is where the trouble starts ....
However, when I proceed I get an error like this :
It's clear that perl doesnt like to load the same module within each package - most likely related to the symbol table and keeping namespaces clean.
I have discovered a fix - by simply creating another module file as a symbolic link e.g.
However, this seems like a crude fix, and I feel like my understanding of this entire is unsatisfactory.
This perl disciple/fan would appeciate any help or pointers.