Forgive my 'newness' but I noticed a tendency to go with a module even if it isn't "core" than it is to go without. I noticed this thread, for example. Both examples are 2 lines. Yet solution that uses a module had (at the time I last checked) more votes than the core solution that didn't use a module at all. Is it really that much easier to read the 2nd solution?

This got me to thinking. So why are we pushing the use of modules so much? And when is it better to go with core instead of downloading a module? When does requiring a module for your solution begin to make sense over a solution that doesn't require a module? Under what criteria should the use of a module be suggested? (emphasis added at update).

In general, I try to stay clear of solutions that require a module that the user isn't likely to have by default, even at the expense of some possibly more elegant solution. What do you all think?

UPDATE:
I think too many people hear are interpreting what I've said as "It's better to not use modules." That isn't what I'm talking about. I'm talking more about "by what criteria do you decide to go searching for a module?" There is a big difference. Let me add a few things as well:
1: In corp America it can be non-trivial to have modules added to servers for production deployment.
2: If there IS a bug in a module, vs a bug in code I've written, it's almost always easier for me to debug my own code. I think that's a general truism. It's always easier to debug one's own code than someone else's.
3: I heart CPAN, so there is no need to sell me on it. I gave up writing my own XML reader 6 years ago. I wouldn't want to go back to doing things like that again.

I guess my brain won't accept a blind statement that everytime I'm coding in perl I should be scanning CPAN to see if something has already been done. There has to be some general guideline to follow to best know when to hit the CPAN archive.

--
I used to drive a Heisenbergmobile, but every time I looked at the speedometer, I got lost.

In reply to Module Bloat and the Best Solution by KurtSchwind

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.