…please explain to me when using a module is most beneficial?
When it’s beneficial. :)

A lot of my work with Perl revolves around web applications. My list of beneficial modules is almost always along the lines of

I wouldn’t be seen out without them. Obviously there are many different approaches, these are the ones I use.

One module I’d like to draw attention to is the marvellous Data::Page “help when paging through sets of results”. And that is exactly what it does, no more, no less. The author includes a note in the docs

It has been said before that this code is "too simple" for CPAN, but I must disagree. I have seen people write this kind of code over and over again and they always get it wrong. Perhaps now they will spend more time getting the rest of their code right...
“…always get it wrong.” Done that! :) I’ve never had so many off by one errors in so few lines of code. It even gives you the numbers for your MySQL limit clause. This for me is an excellent example of a beneficial module.

But…

I’m not a fan of all modules. Although frequently recommended by senior monks I have never gotten on with File::Find and its relatives. My use case is almost always “give me a list of all files under this dir”. I’ll grep for what files I want myself. So I’ve hand rolled a sub that does just that and everything got better, no more battling with, imo, quite difficult docs. I’m not advocating anyone else adopt this approach.

I find modules extremely beneficial. There are times when I find them a nuisance and avoid them but that is very rare indeed.


In reply to Re: w/Modules and w/o Modules by wfsp
in thread w/Modules and w/o Modules by Jeri

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.