I made a lovely silly mistake yesterday. One of the kind where neither strictures, nor warnings, nor syntax highlighting can help. One of the nasty kind where the code appears to work, and produces a plausible but incorrect result. Something functionally equivalent to:
my $bitstring = get_bitstring();
# Number of records is stored in first octet
my $record_count = oct $bitstring;
for my $i (0 .. $record_count - 1) {
process_record( get_record($bitstring, $i) );
}
It must have taken the best part of ten minutes for me to spot the two-character brainfart that was causing that never to process any records...
Seriously, I don't think there's any way to prevent "doh" moments. The best one can hope to do is to prevent those errors that can be prevented, and make sure your tests are comprehensive enough to catch the rest.
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
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, 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, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
Outside of code tags, you may need to use entities for some characters:
| |
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.
|
|