Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??

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.


In reply to Re: Which modules provide highest return-on-investment? by pjf
in thread Which modules provide highest return-on-investment? by missingthepoint

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 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?Last hourOther CB clients
Other Users?
Others about the Monastery: (5)
As of 2024-04-18 05:35 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found