|Pathologically Eclectic Rubbish Lister|
Exporting symbols from another packageby crashtest (Curate)
|on Mar 29, 2010 at 19:22 UTC||Need Help??|
crashtest has asked for the
wisdom of the Perl Monks concerning the following question:
I have a single module file (say, Foo.pm) that defines subroutines for several packages, for example like this:
What I'd like to do is to be able to use Foo and import some subroutines from a specific package in the module file into the caller's namespace (in this case, the "transform" subs). I figured I'd be able to set it up like this:
This doesn't seem to work - I get an undefined subroutine error; it appears none of the transform methods were exported.
I suppose I could break out the "transforms" into their own separate module and use it separately. But I was wondering if any wise Monks have advice for me on this. Is it possible to export symbols from another package (without too many gyrations?) Am I trying to do something unnatural or unadvised?
Thanks in advance for your input.