You might want to look at the CPAN module Devel::Trace.
It prints out program lines as they're executed. See http://www.plover.com/~mjd/perl/Trace
for details. Might be easier than using the standard debugger.
More interestingly, there's the Devel::TraceFuncs module, which does this:
Devel::TraceFuncs lets you instrument your programs, so you can see
what subroutines get called when, and by whom. This is particularly
useful if you have a timing problem that doesn't show up if you use
the debugger (a "heisenbug").
The following program:
use Devel::TraceFuncs qw(trace debug);
sub foo {
trace(my $f);
debug "hi";
}
trace(my $f);
foo(1, 2);
debug "there";
produces this output:
+-> global
| +-> main::foo(1, 2) (in t.pm:10)
| | hi (in t.pm:6)
| +-< main::foo(1, 2) (in t.pm:10)
| there (in t.pm:11)
+-< global
I haven't tried these, so your mileage may vary.
Also, read Refactoring by Martin Fowler. Great advice in there
about how to cope with legacy pasta.
stephen
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: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.