Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
I am the choir that you are preaching to.

I find that the use of modules is the most compelling reason to use Perl. Once you get into the habit of looking on cpan before you code, you will find your productivity growing in leaps and bounds (as well as your reputation as a miracle worker at your job).

Let me share what happened to me this morning. I was writing code to deal with a really bad ticketing system that my company uses. The saving grace is that it is built on top of a database, so i can manipulate it's data.

I wrote a query that inserted formated data into a field in the db, but when i looked at the results in the app, the newlines were gone, replaced by black boxes. I (correctly) assumed that the app was expecting to see dos eol semantics, rather than unix.
I'm old and the part of my brain that remembers eol semantics punted them long ago to make room for something more important. But...

A quick search on cpan for "DOS NL" revealed the Text::FixEOL module, "cpan Text::FixEOL" installed it, and 2 lines of perl code implemented it. In less than 5 minutes, my problem was solved.

And because the modules is on cpan, i know it is tested on any platform i might ever use this code on, and i am far more sure that it is correct than I ever would be if I had implemented it myself.

Yay Perl!


-pete
"Worry is like a rocking chair. It gives you something to do, but it doesn't get you anywhere."

In reply to Re: Top Seven (Bad) Reasons Not To Use Modules by dreadpiratepeter
in thread Top Seven (Bad) Reasons Not To Use Modules by bellaire

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 having an uproarious good time at the Monastery: (4)
As of 2024-04-19 03:04 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found