PWBENNETT has asked for the wisdom of the Perl Monks concerning the following question:

Looking for Perl developers who know about inheriting from Math::BigInt to help me improve the cpantesters results for my module Net::IPAddress::Util.

The problem I'm seeing seems to be with certain versions of certain Math::BigInt backends not simply obeying the normal rules of Perl inheritance. Either that, or I'm missing something critical in how I'm trying to inherit.

The real key issue is that I want to be able to let my module's users benchmark the performance of the different backends on their own particular config, and pass in the right qw( lib try only ) flag to my module, so I can in turn pass it to Math::BigInt.

Replies are listed 'Best First'.
Re: Subclassing Math::BigInt while keeping the import options
by ikegami (Patriarch) on Oct 09, 2011 at 19:10 UTC

    If your child class calls the base class's import, the base class will export to your package. If you can, use something like

    sub import { ... do something ... goto &Base::Class::import; # Hide us from caller(). }

    If you can't, hope that the base class uses Exporter, and use its export_to_level function instead of import.