in reply to Re^2: How does one choose among modules?
in thread How does one choose among modules?

Yes, MIME::Lite can use Net::SMTP. It can also pipe to sendmail. The point is that using MIME::Lite makes the mechanics of SMTP irrelevant, whereas you must understand those mechanics to use Net::SMTP directly. That makes them very different. The difference is akin to that between using mutt to read and write your mail, and using telnet to ports 110 and 25 and just talking POP and SMTP yourself like a Real Programmer would.

To answer your meditation - if you want to figure out which of those modules to use you *must* have some understanding of what you're trying to do, and what the modules do. The best way to do that is to consult something more knowledgeable than yourself. That something is generally the modules' documentation.

The answer you're probably not looking for to the question of "how on earth do I even find out which modules I should consider to do task FOO" is "ask other people".

  • Comment on Re^3: How does one choose among modules?

Replies are listed 'Best First'.
Re^4: How does one choose among modules?
by mr_mischief (Monsignor) on Oct 10, 2007 at 14:46 UTC
    I can type SMTP and POP3 into the ports. That's not even so much of a programmer's skill as a sysadmin's skill AFAICT. I'm not so good at decoding Base64-encoded MIME attachments in my head and visualizing the data as a picture or hearing it as a sound. An actual client helps with that.

    As far as your problems with the hypothetical example, it's entirely possible instead of using MIME::Lite to use another MIME module and to use Net::SMTP. Someone who's using MIME in a project for more than just sending mail but also has to have it send mail would probably not end up using a specialized MIME email sending module and other specialized MIME modules. They'd probably use a more general MIME module and a general mail-sending module.

    Just because someone is looking for modules to do something and hasn't settled on one doesn't mean they have issues with the concepts they are trying to use. Throwing around phrases like "real programmer", saying they'd do this low-level thing and by extension that if you do something a bit higher-level you're not really a "real programmer" just lowers the tone of the conversation, IMO. If your precise need is to send MIME-encoded email, MIME::Lite is probably the quickest way to write you application. A "real programmer" should be able to use that. If you're sending email that's not MIME-encoded, it'd be silly to overlook the core Net::SMTP and download a MIME-encoding wrapper around it.

    BTW, MIME::Lite doesn't really make the mechanics of SMTP irrelevant. It just hides them until something breaks, like not having sendmail installed or having a port blocked. If you don't understand the system outside your program, you're not likely to be able to get any program that interacts with the system to work properly.

    Actually, the best way I've found to get a list of modules to consider is CPAN. In fact, if someone asks on here the general question of which to consider, the monks invariably mention the person could have made a short list from a CPAN search and asked more specific questions about the modules on that list. Usually this is along with more direct advice, but I think the search really is a good place to start.

    For understanding what the modules do, would it be unhelpful to have a list of what modules in a certain application area do side by side for comparison? Sure, reading the docs is usually necessary to use the module. Why wouldn't it be nice to only read the docs of the modules that have the features you need?