in reply to Check if module is installed
I assume what you really want is to provide an option for the program can send mail in one of a few possible ways. Or, not at all, if it's not available. (Note that it's possible that you cannot send mail even though you have the necessary mail modules.)
In that case, I'd write a little wrapper module that tries to load one of a few mail modules, writes down what module to use, and provides a hook to send mail using that module without exposing too much to the client program.
Perhaps you can base that on a module like MIME::Lite, since that already has a way to transparently send mail using one of a few possible modules.
|
|---|