in reply to Checking if a subroutine has been defined in a package...

Howdy!

CAVEAT: this is off the cuff and untested...

Consider:

my $foo = bless {}, 'package::name'; $foo->can('function');
That is, bless something into the namespace you are checking and use that object to try 'can' against.

UPDATE:

Reading Re: Re (tilly) 1: Strict, strings and subroutines by merlyn, I see where this needs to not search ISA, leading (by way of cribbing)

do { local @ISA; my $foo = bless {}, 'package::name'; $foo->can('function'); };

yours,
Michael