http://www.perlmonks.org?node_id=1001415


in reply to Re^2: subroutine good practise
in thread subroutine good practise

If you must encode this within the module itself, I prefer using something like the if pragma.

My preference is to pass in the dependency when using the module from the calling code, as it sounds like the calling code is most responsible for deciding which dependency to use.