in reply to plugins and inheritance

If you want the reverse of inheritance, then reverse the inheritance. Have each plug-in do:

unshift @MainPackageIReplace::ISA, __PACKAGE__;
I use unshift rather than push since I assume that you want a newly loaded plug-in to override a previously loaded plug-in.

        - tye (but my friends call me "Tye")

Replies are listed 'Best First'.
Re: (tye)Re: plugins and inheritance
by dash2 (Hermit) on Mar 08, 2001 at 17:36 UTC
    Nice idea, but that wouldn't actually override functions in the main package, would it? E.g.
    package MainOne; sub foo { ...} package NewPlugin; unshift @MainOne::ISA, __PACKAGE__; sub foo { warn "new plugin!" ... }
    Now calls to MainOne::Foo would still go to MainOne itself, right? You could provide new functions with this idea, but not override existing ones.

    dave hj~