CPAN to the rescue

Dominus to the rescue!

Devel::Trace to the rescue!

crazyinsomniac to the rescue!

$> more file #!/usr/bin/perl -w use strict; _1: f(); _2: d(); _3: f(); sub f { print "F\n"; } sub d { print "D\n"; f(); } $>perl -d:Trace file >> file:4: _1: f(); >> file:8: sub f { print "F\n"; } F >> file:5: _2: d(); >> file:9: sub d { print "D\n"; f(); } D >> file:9: sub d { print "D\n"; f(); } >> file:8: sub f { print "F\n"; } F >> file:6: _3: f(); >> file:8: sub f { print "F\n"; } F
The Devel::Trace link above will also yield Devel::TraceMethods, which was born here (a wheel of chromatic, which I reinvented last week), along with Devel::TraceLoad and Devel::TraceCalls. They're all worth a look, and the Trace(Calls|Methods) modules are very useful when working with parsers you're not familiar with (like Pod::Parser, which is how I stumbled upon all of these, after writing my own of course ;D -- the whole Devel:: tree is full of goodies)

Happy Coding!!

update: This very good info to know, and will help you with debuggin your program, but an added feature, would be a duplication of the filehandles/sockets .... what I mean is, if your program opens a file/socket handle, and data goes over it, it'd be nice if -d:Trace would log that stuff as well ;)

 
______crazyinsomniac_____________________________
Of all the things I've lost, I miss my mind the most.
perl -e "$q=$_;map({chr unpack qq;H*;,$_}split(q;;,q*H*));print;$q/$q;"


In reply to (crazyinsomniac) Re: Redefining print by crazyinsomniac
in thread Redefining print by suaveant

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.