in reply to Abusing Exporter for Conditional Inheritance

I'm puzzling over my own HTML::TreeBuilder inheritance conundrum, so this question interests me, but I suspect that I don't quite follow, because my naïve inclination would be to pass the class of the Stone to the StoneGatherer's constructor.

my $g = Gatherer->new('Stone::Red');

P.S. As an aside, there are examples of abusing Exporter out there, such as with Test::More:

  use Test::More tests => 42;
Any other examples out there? ;)

SOAP::Lite seems to go pretty heavy on the ol' import.

the lowliest monk

Replies are listed 'Best First'.
Re^2: Abusing Exporter for Conditional Inheritance
by mojotoad (Monsignor) on Mar 17, 2005 at 05:47 UTC
    This was my first inclination as well, but when you muck with @ISA, it affects all instances, rather than the particular one you're constructing. With perl, at least.

    I suppose you could localize @ISA, but I haven't tried that.

    Has anyone else? Is it just as much of a bastardization as what I've suggested above?

    Matt

    Update: this is of interest: Re: Re: Re (tilly) 1: Strict, strings and subroutines
    (thanks to Revelation for the node reference)