Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Comment on

( #3333=superdoc: print w/ replies, xml ) Need Help??

Put the following code in a file called: /yourperl/site/Devel/Calls.pm:

package Devel::Calls; our $lastsub; sub DB::DB { my( $p, $f, $l, $sub ) = caller(1); return if $lastsub and $sub eq $lastsub; printf STDERR "%s(%u): %s()\n", $f//'unknown', $l//'0', $sub//'unknown', $lastsub = $sub; return; } 1;

And then invoke your scripts with perl -d:Calls yoursript.pl

You'll get a trace showing file, line and subroutine name whenever a subroutine is entered, something like:

C:\test>perl -d:Calls nestedSubs.pl 1 2 3 unknown(0): unknown() nestedSubs.pl(31): main::aaa() nestedSubs.pl(29): main::bbb() nestedSubs.pl(28): main::ccc() nestedSubs.pl(27): main::ddd() nestedSubs.pl(26): main::eee() nestedSubs.pl(25): main::fff() nestedSubs.pl(24): main::ggg() nestedSubs.pl(23): main::hhh() nestedSubs.pl(22): main::iii() nestedSubs.pl(21): main::jjj() nestedSubs.pl(20): main::kkk() nestedSubs.pl(19): main::lll() nestedSubs.pl(18): main::mmm() nestedSubs.pl(17): main::nnn() nestedSubs.pl(16): main::ooo() nestedSubs.pl(15): main::ppp() nestedSubs.pl(14): main::qqq() nestedSubs.pl(13): main::rrr() nestedSubs.pl(12): main::sss() nestedSubs.pl(11): main::ttt() nestedSubs.pl(10): main::uuu() nestedSubs.pl(9): main::vvv() nestedSubs.pl(8): main::www() nestedSubs.pl(7): main::xxx() nestedSubs.pl(6): main::yyy() nestedSubs.pl(5): main::zzz() 234

That could obviously be greatly extended, but it may be just what you're looking for.


With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.

RIP Neil Armstrong


In reply to Re: Analyzing Perl Code by BrowserUk
in thread Analyzing Perl Code by nitin1704

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!
  • 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, 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, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • Outside of code tags, you may need to use entities for some characters:
            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.
  • Log In?
    Username:
    Password:

    What's my password?
    Create A New User
    Chatterbox?
    and the web crawler heard nothing...

    How do I use this? | Other CB clients
    Other Users?
    Others chilling in the Monastery: (6)
    As of 2014-08-23 10:43 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?

      The best computer themed movie is:











      Results (173 votes), past polls