Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses

Re: w/Modules and w/o Modules

by wfsp (Abbot)
on Sep 21, 2011 at 11:00 UTC ( #927123=note: print w/replies, xml ) Need Help??

in reply to w/Modules and w/o Modules

…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.


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.

Replies are listed 'Best First'.
Re^2: w/Modules and w/o Modules
by Anonymous Monk on Sep 21, 2011 at 11:15 UTC

    I’m not a fan of all modules

    A fellow discriminator, eh :)

    never gotten on with File::Find ... give me a list of all files under this dir

    You're using glob right?

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://927123]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (6)
As of 2018-02-19 20:16 GMT
Find Nodes?
    Voting Booth?
    When it is dark outside I am happiest to see ...

    Results (266 votes). Check out past polls.