in reply to Re^2: Detecting undefined subroutines at compile time
in thread Detecting undefined subroutines at compile time

Did he really ask for undefined methods? Those calls are per definition only resolved at runtime.

Despite manipulating UNIVERSAL in your example, the functions foo() and bar() are still found by B::Xref

$ perl -MO=Xref,-r tst.pl|grep subused tst.pl (main) 2 main & foo + subused tst.pl (main) 3 his & bar + subused ...

I agree that every approach can be somehow tricked out, but IMHO the vanilla cases are well covered by B::Xref.

Cheers Rolf