Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid

Perl Modules

by carlriz (Beadle)
on Mar 21, 2014 at 17:14 UTC ( #1079303=perlquestion: print w/replies, xml ) Need Help??
carlriz has asked for the wisdom of the Perl Monks concerning the following question:

This is a question out of curiosity. What are the most commonly used perl modules, and what do they do? What makes them so useful?

Replies are listed 'Best First'.
Re: Perl Modules
by hippo (Monsignor) on Mar 21, 2014 at 17:36 UTC

    strict is the most commonly used and I say that with no hard evidence whatsoever. But even if it's not, it should be! What does it do? Why, it traps fat-fingered bugs and stops you for doing a whole heap of really dumb ideas, at least until the point that you think you can give yourself enough rope.

Re: Perl Modules
by Bloodnok (Vicar) on Mar 21, 2014 at 17:54 UTC
    I seem to find that the modules that I use the most are (in particular order) strict, warnings, Data::Dumper, Log::Log4perl & Test::More.

    The first 2 are, IMO, essential in as much as they let perl do even more of the work to help write half-decent code with fewer gotchas.
    Log::Log4perl allows me to flexibly instrument the code and Test::More, I use for writing unit tests in a, quite frequently vain, attempt to show that my code does what it should do.
    Finally, Data::Dumper supports my, admittedly archaic, code debugging as required when the code is observed (by Test::More test case failures) to be implementing NWITIAF (Not What I Thought I Asked For) behaviour(s).

    A user level that continues to overstate my experience :-))
Re: Perl Modules
by CountZero (Bishop) on Mar 21, 2014 at 17:49 UTC
    I think strong contenders for the top 5 are DBI and CGI. Scores of other popular modules build upon these cornerstones. Low level database access and the CGI protocol for webaccess are probably two things almost every programmer will need to do ever so often.


    A program should be light and agile, its subroutines connected like a string of pearls. The spirit and intent of the program should be retained throughout. There should be neither too little or too much, neither needless loops nor useless variables, neither lack of structure nor overwhelming rigidity." - The Tao of Programming, 4.1 - Geoffrey James

    My blog: Imperial Deltronics
Re: Perl Modules
by tangent (Priest) on Mar 21, 2014 at 21:32 UTC
    I'll confess that I didn't know about Data::Dumper for a long time but when I discovered it my programming experience was transformed. It will print out the structure of practically everything you throw at it, even objects. So many problems involve data not being what you think it is. A godsend.
      I don't know why people use Data::Dumper. Just use the debugger then try the "x" command, which essentially does Data::Dumper dynamically on anything you "x". And you don't have to add all of that unsightly Data::Dumper, dump and print commands and output...
Re: Perl Modules
by karlgoethebier (Parson) on Mar 22, 2014 at 17:46 UTC
Re: Perl Modules
by aartist (Scribe) on Mar 22, 2014 at 21:49 UTC
    I like Data::Dumper as common module. After that, there are horses for courses. Look 564134 and 30794
Re: Perl Modules
by Anonymous Monk on Mar 21, 2014 at 18:53 UTC
    Why does this show up in Seekers and Gates?

      It's in "Seekers" because that's the right section for this type of question. It's in "Gates" because it was Front-Paged. Front-Paging does not remove a post from its original section.

      -- Ken

Re: Perl Modules
by DrHyde (Prior) on Mar 25, 2014 at 11:34 UTC

    There's a difference between the modules most commonly used by my code and those most commonly used by me. My code uses DBI more than it uses DBIx::Class, because necessarily any use of DBIx::Class also uses DBI, plus I have a handful of places where I use DBI directly. But *I* most commonly use DBIx::Class because I'd be a damned fool not to.

    Off the top of my head, I think that the most commonly used modules here at work, excluding pragmata like 'strict' and 'warnings', are, in no particular order, DBIx::Class, Data::Dumper, Scalar::Util, Test::More, and, unfortunately, Moose.

    Why "unfortunately, Moose"? I believe it to be a solution in search of a problem, and I hate all the weird magic that it encourages.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://1079303]
Approved by GotToBTru
Front-paged by GotToBTru
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (5)
As of 2017-03-23 22:57 GMT
Find Nodes?
    Voting Booth?
    Should Pluto Get Its Planethood Back?

    Results (294 votes). Check out past polls.