Think about Loose Coupling | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
For the sake of completeness, yet another approach would be to directly import Exporter's import method into the namespace of your module. In that case it doesn't need to be looked up via inheritance, so you don't need to setup @ISA or use base ... In other words, from the following 3 options, you can choose whichever you like best:
(Also, note that I changed the package name to "One" (capitalized). AFAIK, lowercase module names are - by convention - reserved for pragmatic modules like use strict;, use integer;, etc.) BTW, a slight peculiarity with use strict; use warnings; in this particular case is that it does not (and cannot) warn you about potential problems due to not loading Exporter yourself (because, as ferreira pointed out, Exporter already is being loaded as a side effect of using strictures). For this reason, it could be argued that options 2 or 3 are the ones to prefer, as they do not share this potential pitfall... In reply to Re: Issue with Exporter
by almut
|
|