laziness, impatience, and hubris | |
PerlMonks |
Re^3: Exporter/@ISA confusionby qhen (Acolyte) |
on Jun 10, 2014 at 08:55 UTC ( [id://1089399]=note: print w/replies, xml ) | Need Help?? |
Thanks - that's what I needed to know. I've been trying to stick to the "modern" Perl way (ie, following recommendations by chromatic, conway, et al), and also trying to keep things simple and clean without having to resort to Moose, etc. I've been using Exporter/@ISA and always wondered whether it was really needed as of Perl 5.8 (admittedly I have not spent the time to study the matter; time I often don't have) - the more syntactic cruft I can cut out, the better. I sometimes look at the relative elegance of Python and wish the same were true for Perl (which I love). So, bottom line, I can simply exclude use Exporter; our @ISA = qw(Exporter); when creating a new class and/or inheriting from an existing, but still use: to allow optional/selective exporting of methods. Someone else commented: You need to use use Exporter; in your module to get the @EXPORT array into the calling script/module...So, in order to use @EXPORT/@EXPORT_OK, I still need to use Exporter.
In Section
Seekers of Perl Wisdom
|
|