Thanks for your comment. Yes, I understand your concern and I second your opinion that print statements for debugging are a bad idea, one of the reasons I looked into using callbacks that could allow the test software to inspect intermediate results within a sub. There are some situations (e.g. "large amount of state data shared among the different steps of a function" see 880089) in which intermediate values inside a sub need to be evaluated, but instead of printing these ase debug statements I have been using a "test point" analogy that I describe here 882331. This allows a your test to diagnose the problem better before firing up the debugger to fix it.
Of course many of this situations can be avoided with better design, but in the real world time and budget constraints don't allow for adequate refactoring to fix these design problems. The test point idea was precisely for eliminating all these print-debug statements and move these intermediate values to be evaluated in the test suite instead of reading and making sense of all the verbose debug statements.
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.
|