Pathologically Eclectic Rubbish Lister | |
PerlMonks |
Re^2: Subroutines with the same name, in different packagesby Anonymous Monk |
on Feb 05, 2010 at 18:12 UTC ( [id://821623]=note: print w/replies, xml ) | Need Help?? |
Indeed. To the OP: exporting OO methods serves no purpose. Exporting puts the sub into the importer's package, eg main.
But when you call a method, you (usually) use the package name or an instance of that package, eg my $foo = Foo->new(); $foo->frob();. All the calling package (usually) needs to do is to use Foo; so that the class you're going to be using is loaded. In short: don't export methods.
In Section
Seekers of Perl Wisdom
|
|