G'day Marshall,

++ They're all good techniques which I use too. I also sometimes add a temporary exit statement: often in a loop to see print debug statements for just one iteration.

I almost always add something like

# TODO - debugging

just before those things so that they're easy to subsequently find and remove. My normal syntax highlighting displays the commented "TODO" in a horribly contrasting magenta on blue so it's really hard to miss; even without that, it's easy to just search the text for.

"... a really bizarre looking error that I traced back to a ":" instead of a ";" at the end ..."

Unfortunately, that's one mistake I make far too often. It was very difficult to track down when I first used to make it. I now recognise it as just something I do when not releasing the Shift key quickly enough:

$result = function(...): $hashref = { ... }: $string = "...":

It's easy to miss when just reviewing the code because ":" and ";" look very similar; at least now it's easy to find and fix when I get a syntax error reported.

— Ken


In reply to Re^2: REALLY PERL ?? by kcott
in thread REALLY PERL ?? by misterperl

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • 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:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.