Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: Which modules provide highest return-on-investment?

by pjf (Curate)
on Oct 13, 2008 at 04:48 UTC ( [id://716738]=note: print w/replies, xml ) Need Help??


in reply to Which modules provide highest return-on-investment?

The modules I find give me the biggest bang-for-buck are the ones that allow me to avoid learning other, more costly methods of doing the same thing. strict is an obvious example of this, it tells me up-front when I've made a typo in a variable name, rather than me going through a costly debugging process.

In this regard, Moose is a big win, as it means I don't have to learn Perl's somewhat esoteric OO system

The other big bang-for-buck modules for me personally are ones that I've written myself, and which I find myself using in practically every program. IPC::System::Simple means I never have to look at $? again, or find myself wishing Perl would allow backticks without invoking the shell, or wishing that system() really did work the same way on all systems.

All my code these days start with use autodie. Having to write or die... after a call to open, close, chdir, unlink, binmode, rename, mkdir, rmdir, fork, etc etc is a total waste of time for me. Using autodie means not only does leaving out the manual error handling becomes correct, but I end up with nicer looking errors, and a number of esoteric bugs go away (eg, calls to fork and open which can legitimately return zero for success, and undef for failure).

When I move from wanting my program to simply die on error to something more complex to recover from that error, autodie gives me sane upgrade path, since the exceptions it produces contain full information as to which call failed, its argument, location, errno, and other pertinent information.

Since I've just turned this post into a massive advertisement for autodie, I should link to an old video on its usage. The big changes is that autodie now works in 5.8.x (not just 5.10.x), and the exception interface has changed slightly since the beta.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://716738]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others chanting in the Monastery: (6)
As of 2024-03-29 09:50 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found