[Boston.pm] use Exporter vs. require Exporter

Mike Small <[email protected]>
Newsgroups gmane.comp.lang.perl.perl-mongers.boston
Message-ID <[email protected]>
Hi,

Often lately when reviewing code I see...

...
use Exporter;    # I'd like this to be require Exporter maybe in BEGIN
...

our @ISA = 'Exporter';
our @EXPORT_OK = ...;

It bugs me because it fits neither of the two suggested styles at the
top of the Exporter pod (nor the use base or use parent alternatives),
and because I don't feel like it's appropriate to call Exporter's
import() function the way the 'use' above does. They should be using
require or else "use Exporter 'import'" like the docs say.

But I've already mentioned it one other time and my advice was ignored
IIRC. I guess Exporter's import is written so this is harmless, so maybe
I should let it go?


-- 
Mike Small
[email protected]
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.