Pathologically Eclectic Rubbish Lister | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
For some modules, I have come to the conlusion that nothing more than the following is necessary:
I usually end up with code such as the above for very specialized modules that need to load quickly, without any dependencies. Exporter.pm, even split into Exporter.pm and Exporter/Heavy.pm, is beastly long for the most common usages. Some benefits of this approach include the ability to rename objects, and the ability to export lexical objects (in the above case, $SCALAR1 could be declared with my()). I am not recommending my solution over yours. I am agreeing that rolling your own import() function can be very practical, and I believe that the practice suits the Perl mindset. Exporter.pm is one (convenient?) way to do it. It isn't the only way to do it. In reply to Re: A simple import() for those special moments
by MarkM
|
|