I build in a option of $verbose. This means I print out statements if $verbose. If I set $verbose to 0 I don't see the verbose output anymore.

I use something similar. I sometimes have lots of if $debug statements if I need them. Once I'm finished I can delete them if I want.

I also break down the code to small subroutines I can test seperated. So afterwards when I do the whole integration test of my application, it's a test if the logic is right and not if I made a perl mistake...

This is also crucial. I always test the function that I've written against various boundary conditions and then integrate into the whole otherwise you get horrendous error messages in your program.

Plus my two cents with regards to debuggers....I've done both print statements and have used a debugger and I have to say that I prefer print statements! I've always found debuggers a pain to use but YMMV.

metadoktor

"The doktor is in."


In reply to Re: Re: Re: Perl debugging - a look at 'beta' mechanism by metadoktor
in thread Perl debugging - a look at 'beta' mechanism by vladb

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.