in reply to Need help with clashing method names

It's not uncommon to have third-party modules to export names,

I always explicitly specify the functions I import for other reasons, so it doesn't matter what third-party modules export.

use B qw( ); # Import nothing
use B qw( foo bar ); # but not moo

It doesn't solve the problem, but it limits the chance of it happening.

use B qw( moo ); # doh!

If you were paranoid, you could import as follows:

use B qw( ); BEGIN { *_moo = \&B::moo; }

Then the imported sub will be named _moo. But I don't think it's worth the effort.

Replies are listed 'Best First'.
Re^2: Need help with clashing method names
by dk (Chaplain) on Feb 13, 2009 at 18:34 UTC
    Indeed, explicit specification is a tiny bit better than implicit like tag-based ":all" etc, but it still doesn't solve problem if the imported name will be used in the next version of the parent class, for example.

    I've sent a patch to initiate a discussion in perl5-porters, we'll see how it goes.