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

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

Thread Previous | Thread Next
From:
Brandon Black
Date:
May 2, 2007 09:48
Subject:
Re: use parent 'Some::Class' @import_list;
Message ID:
84621a60705020948t1def551aja4a60369c4b709b8@mail.gmail.com
On 5/2/07, Ovid <publiustemp-p5p3@yahoo.com> wrote:
> --- Brandon Black <blblack@gmail.com> 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.
>
> It's worth noting that "our @ISA" generally means that base classes are
> determined later than with "use base", thus ensuring that there's a
> subtle, but distinct, difference.  Some trying to call inherited
> methods before the @ISA gets assigned is going to be bitten by the
> above code.
>

Right, that and the "require" comment earlier basically amount to
knowing what's in BEGIN and what isn't though (or putting them in
BEGIN if necessary).

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