pjbrenner wrote:

I cannot put print statements in because the program is to large and I don't yet know where it is failing.

Personally, I find that the size of a program is usually irrelevant to finding out where to put print statements for debugging. I trace the program flow and essentially use a binary search to narrow down where to put the print statements.

A simple example: for 500 lines of code, I put a print at 250. Does the program die before it? I put the print at 750. A binary search quickly narrows down where the problem is.

For your error message, it sounds like you may have an object instantiation that is returning undef, or an unblessed reference. grep the code base for the word "format" and see how your program might be trying to access the appropriate code.

Cheers,
Ovid

Join the Perlmonks Setiathome Group or just click on the the link and check out our stats.


In reply to Re: Debugging Perl Program by Ovid
in thread Debugging Perl Program by pjbrenner

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.