develooper Front page | perl.perl5.porters | Postings from April 2007

Re: use parent 'Some::Class' @import_list;

Thread Previous | Thread Next
From:
Ronald J Kimball
Date:
April 29, 2007 18:42
Subject:
Re: use parent 'Some::Class' @import_list;
Message ID:
20070430014208.GA94624@penkwe.pair.com
On Sun, Apr 29, 2007 at 08:11:50PM -0500, Brandon Black wrote:
> Personally, I think most people are better off without "use base".
> For MI, it's just:
> 
> use Foo;
> require Bar;
> our @ISA = qw/Foo Bar/;
> 
> You can choose require vs use to decide whether you want import called
> or not, and since it is assignment rather than pushes, it's not an
> efficiency issue like the individual push statements of base.pm.

Avoiding a call to import seems like the wrong reason to choose require
over use.  You should choose require if you want to load the module at
run-time rather than at compile-time.  If you simply don't want import to
be called, you can do C<< use Bar (); >>.

Ronald

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About