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.
In reply to Re^3: subroutine good practise
by chromatic
in thread subroutine good practise
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |