in reply to test for subroutine existence

As long as you are using a simple module with no inheritance, you could rely on can to do this:

if ( __PACKAGE__->can( 'sub_to_test' ) ) { ... }