tags:

views:

477

answers:

21

Which lesser-known CPAN modules have you found to be real gems?


Please post links to the modules like this

[`Example::Module`][Example::Module]
[Example::Module]: http://search.cpan.org/perldoc/Example::Module

Or post a link to the version control repository.

A short description would be good to include, too.

+5  A: 

Regex::PreSuf

Sinan Ünür
+3  A: 

Lingua::EN::FindNumber

Sinan Ünür
+4  A: 

How about "the builtin function set"?

I can't count the number of times I've struggled reading code littered with unfamiliar modules and APIs just to discover it was doing the equivalent of glob() or grep() or unpack(). There's lots of value in CPAN, but familiarity with the basic language is more important than extensive library knowledge IMHO.

Andy Ross
I don't think the builtins are particularly "Lesser Known" or "underrated," and I can't honestly say that I've encountered problems with people *overusing* modules where builtins would suffice... I can imagine that would be pretty frustrating, though!
Adam Bellaire
There are a lot of builtins that people never encounter, and unpack is a great example. I've run into many, many problems of people overusing modules for the most trivial things where the installation woes come from the test dependencies, not the actual module dependencies.
brian d foy
@brian: I guess my experience is limited in that regard, then. Fixing other people's module overuse is something for me to "look forward" to. :)
Adam Bellaire
`pack` and `unpack` can be difficult to figure out, so I can understand using a module in their place.
Brad Gilbert
+7  A: 

Catalyst

It may be very well known to some, but I have come across many, many Perl developers and companies who have never heard of it yet are constantly dealing with their own in-house solutions or outdated technology.

It's worth spreading around whenever possible, and if one new person stumbles upon this link, my job here is done.

As a bonus, the dependency list will undoubtedly turn you on to a slew of underrated modules that turn out to be real gems!

jsoverson
It is too well known by anyone who uses cpan to belong here.
Evan Carroll
I don't see how cpan and catalyst aren't related in any way. There are many people who use cpan who have never heard of catalyst.
jsoverson
+2  A: 

Check out chromatic's blog post, Aspects of a Novice-Friendly Distribution. He lists a few really great modules that he suggestions should be provided to Perl novices:

If you're not using Moose by now, you're missing out.

a paid nerd
I'm not sure I would call any of those (except maybe Try::Tiny) obscure.
mpeters
A subjective question begets a subjective answer ;)
a paid nerd
+4  A: 

Data::Dumper

I don't know how 'obscure' it really is, but I find it to be a fantastic debugging tool. It lets you expose almost everything there is in a complex data structure, and formats it all nicely. As an added bonus, its output has the handy property of being the Perl code required to rebuild said data structure with an eval.

Robert P
I would conversely say XXX.pm is much, much more useful and pretty. I'll answer this question twice. ;) I use XXX.pm *every* day.
Evan Carroll
DDS is better than both. YAML::XS is a close second.
jrockway
`Data::Dump` (no "er" on the end) is even better -- e.g. it doesn't try to populate those annoying `$VAR1` etc. variables. As the author says, "The Data::Dump module grew out of frustration with Sarathy's in-most-cases-excellent Data::Dumper."
j_random_hacker
+12  A: 

My vote is for Convert::Binary::C.

Simply point it at some C header files, and you can then easily pack and unpack structures with amazing ease. This module allows you to configure settings so that it can accommodate big-endian 64 bit systems and little-endian 8 bitters, and everything in between.

You can also use hooks to handle serializing and deserializing data into perl types. For example, if you have fixed point numbers that you want to treat as floats in your perl code, you can set a hook on the typedef, so that translation is automatic.

This module is brilliant. I do embedded development in C for ARM and 8051 systems and this module makes my life much easier. But anyone who needs to work with big ugly C structures should use this module. It's so much more powerful and easier to use than pack/unpack templates.

daotoad
+9  A: 

I'm a fan of the Inline modules for embedding foreign (i.e., C++, Java, etc.) code in your Perl scripts. It is so much easier to build a hybrid application than it used to be.

mobrule
I've only had to use it once for a bottleneck sub, and in comparison to XS, it looked a million times easier. My only gripe is that it lives ugly '_Inline' dirs everywhere, I wish it'd detect the OS and use '.inline' for linux.
brunov
+2  A: 

Acme::Tools

willwillis
+9  A: 

Here is a list of modules I use "regularly" which maybe classed as underrated:

Continuity offers a different paradigm to doing web applications in Perl and definitely deserves more attention (methinks!).

/I3az/

draegtun
+1 for `Continuity` and `Squatting`.
Sinan Ünür
`use feature 'say'`
Brad Gilbert
draegtun
+2  A: 

Capture::Tiny

mpeters
+3  A: 

CHI

mpeters
+1  A: 

HTML::FillInForm

mpeters
+1  A: 

HTML::Scrubber

mpeters
+4  A: 

File::ShareDir is something which would be useful to a lot of people if they knew about it.

Kinopiko
+4  A: 

PDL

brunov
+7  A: 

Git::CPAN::Patch It will allow you to easily (1) download a CPAN distro, and all of the earlier versions, (2) convert it into a git repository, and (3) patch it and (4) send the patch as an RT bug report via rt-email.

You can even send multiple patches, this is great for something like doc-bugs because it makes the processes massively simpler.

Evan Carroll
+3  A: 

XXX, This module uses a very simply api to dump a data structure, and the output is YAML. Which IMHO is many times easier to read than the Perl-syntax Data::Dumper gives. You can also make a quick serialized-file db with the dump which can then be brought into other languages.

See both XXX::XXX() and XXX::YYY() gotta have them both. Great tools!

Evan Carroll
+3  A: 

HTML::Seamstress This module for HTML "templating" provides the cleanest and strongest separation Index between Perl code and HTML. It is the Perl analogue of XMLC for Java.

Unlike all other solutions which resort to mini-languages, Seamstress weaves HTML and object-oriented Perl together using no additional technologies.

metaperl
+1  A: 
zakovyrya
+3  A: 

Nice question, thanks.

Found myself using a lot:

  1. classes - conventional Perl 5 classes (yes I know about Moose - take a look)
  2. IO::All - combines all of the best Perl IO modules into a single nifty object oriented interface
  3. Smart::Comments - Comments that do more than just sit there
+1 for `classes`. I had no idea it existed.
Sinan Ünür