Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

comment on

( #3333=superdoc: print w/replies, xml ) Need Help??
…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":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (2)
As of 2022-07-04 03:50 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?