I'm surprised nobody else hit on this yet.
Granted I'm a Perl newbie, this seems like a
very important distinction to make -- that a script is a whole different beast from a module.
Even if you
weren't planning on redistributing (and thus documenting, speed testing - beyond your own desires, etc.), the testing is essential for the module. And even if the Carp module doesn't blow up your computer, if it's defective it could cause some headaches in scripts you're trying to run with it.
Anyways, in response to your original question, here's my $0.02. Whenever I need to write a script, a function, whatever, I've found it's definitely easiest to whip out some sort of text editor, and plan out what you need to do.
Generally the process involves first listing what I want to do, and then what design constraints are in place. I agree with all above posters who have said that your first goal is to make it work. Worry about benchmarking and beautification later. With that done, I'll plan out in English a few methods for going about this -- it's easier to see what makes sense and what doesn't this way, no matter how comfortable you are with code. With that in mind, I'll start adding code, and eventually piece them together.
(Then comes the testing, documentation wherever it needs to go, and cleanup).
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.