You're absolutely right -- I wasn't intending to suggest it as a replacement for can_ok. I should have been clear that it's an example for when you want to see if code exists and is not inherited from a superclass (which is what I had needed to check at the time). Doesn't help identify when other modules have exported a function in, or for stuff handled with AUTOLOAD, or installed later, etc. All goes back to my point of needing clarity around what the actual question in before one knows how to write the test.
Code written by xdg and posted on PerlMonks is public domain. It is provided as is with no warranties, express or implied, of any kind. Posted code may not have been tested. Use of posted code is at your own risk.