Ask a Question related to PERL Beginners, Design and Development.

  1. #1

    Default Tracing Subs


    Hi All,

    I have a bunch of scripts which calls a sub from a module, and that module in turn would call another sub from someone else and so on. Skimming through them is driving me crazy.

    Is there a way i can trace the calling of the routines till N levels.


    TIA,
    -Sharad

    Sharad Gupta Guest

  2. Similar Questions and Discussions

    1. Text::Balanced to extract subs?
      dear perl users: I want to write a function that extracts "ordinary" subroutines from perl code. (an equivalent task is extracting all macros...
    2. ref's to subs
      Hello Perler's I am trying to create a hash where each key is a referance to subs. The bellow code produces the expected result, with one...
    3. problems with require, subs and databasehandles
      Hello, I have a main prog and some subs in different files. At runtime I use "require ´pathtofile/´;" to include these files to the main prog...
    4. passing hashes to subs
      Hi, all -- I've gotten rusty and so I'm back again as a rank amateur :-) I have a script that will make a database connection, pull out some...
    5. Help w/ LoadViewState and SaveViewState subs
      Hi, I have implemented the istatemanager interface in control so that i can retrieve values from the viewstate and then update my control. The...
  3. #2

    Default Re: Tracing Subs

    Sharad Gupta wrote:
    > Hi All,
    >
    > I have a bunch of scripts which calls a sub from a module, and that module in turn would call another sub from someone else and so on. Skimming through them is driving me crazy.
    >
    > Is there a way i can trace the calling of the routines till N levels.
    >
    >
    > TIA,
    > -Sharad
    >
    use Carp;

    I think this too will not help you much since you dont seem to know what
    routine is being called

    But What is the bigger Idea, Why do you want to know which modules are
    being called.
    for eg. When I do a readdir(DIR) , and it gives me What I need , Why am
    I bothered what modules does readdir use

    Ram


    ----------------------------------------------------------------

    NETCORE SOLUTIONS *** Ph: +91 22 5662 8000 Fax: +91 22 5662 8134

    MailServ: Email, IM, Proxy, Firewall, Anti-Virus, LDAP
    Fleximail: Mail Storage, Management and Relaying
    [url]http://netcore.co.in[/url]

    Emergic Freedom: Linux-based Thin Client-Thick Server Computing
    [url]http://www.emergic.com[/url]

    BlogStreet: Top Blogs, Neighborhoods, Search and Utilities
    [url]http://www.blogstreet.com[/url]

    Rajesh Jain's Weblog on Technology: [url]http://www.emergic.org[/url]
    ----------------------------------------------------------------


    Ramprasad Guest

  4. #3

    Default RE: Tracing Subs

    The bigger idea is:

    I am trying to understand how some of the scripts work.

    Now the scripts call some *inhouse* nested subroutine calls. I want to see which routine calls what and try to read them to get a better idea of what they are doing.

    I want to rearrange them from this crazy design.

    -Sharad

    -----Original Message-----
    From: Ramprasad [mailto:ramprasad@netcore.co.in]
    Sent: Saturday, August 09, 2003 12:41 AM
    To: Gupta, Sharad
    Cc: [email]beginners@perl.org[/email]
    Subject: Re: Tracing Subs


    Sharad Gupta wrote:
    > Hi All,
    >
    > I have a bunch of scripts which calls a sub from a module, and that module in turn would call another sub from someone else and so on. Skimming through them is driving me crazy.
    >
    > Is there a way i can trace the calling of the routines till N levels.
    >
    >
    > TIA,
    > -Sharad
    >
    use Carp;

    I think this too will not help you much since you dont seem to know what
    routine is being called

    But What is the bigger Idea, Why do you want to know which modules are
    being called.
    for eg. When I do a readdir(DIR) , and it gives me What I need , Why am
    I bothered what modules does readdir use

    Ram


    ----------------------------------------------------------------

    NETCORE SOLUTIONS *** Ph: +91 22 5662 8000 Fax: +91 22 5662 8134

    MailServ: Email, IM, Proxy, Firewall, Anti-Virus, LDAP
    Fleximail: Mail Storage, Management and Relaying
    [url]http://netcore.co.in[/url]

    Emergic Freedom: Linux-based Thin Client-Thick Server Computing
    [url]http://www.emergic.com[/url]

    BlogStreet: Top Blogs, Neighborhoods, Search and Utilities
    [url]http://www.blogstreet.com[/url]

    Rajesh Jain's Weblog on Technology: [url]http://www.emergic.org[/url]
    ----------------------------------------------------------------



    Sharad Gupta Guest

  5. #4

    Default Re: Tracing Subs

    From: "Gupta, Sharad" <Sharad.Gupta@netapp.com>
    > I have a bunch of scripts which calls a sub from a module, and that
    > module in turn would call another sub from someone else and so on.
    > Skimming through them is driving me crazy.
    >
    > Is there a way i can trace the calling of the routines till N levels.
    I think you might like Devel::TraceSubs from CPAN and PPM.

    Jenda
    ===== [email]Jenda@Krynicky.cz[/email] === [url]http://Jenda.Krynicky.cz[/url] =====
    When it comes to wine, women and song, wizards are allowed
    to get drunk and croon as much as they like.
    -- Terry Pratchett in Sourcery

    Jenda Krynicky Guest

  6. #5

    Default Re: Tracing Subs

    On Aug 8, Gupta, Sharad said:
    >I have a bunch of scripts which calls a sub from a module, and that
    >module in turn would call another sub from someone else and so on.
    >Skimming through them is driving me crazy.
    >
    >Is there a way i can trace the calling of the routines till N levels.
    Using the caller() function, you can create your own stack trace.

    perldoc -f caller

    --
    Jeff "japhy" Pinyan [email]japhy@pobox.com[/email] [url]http://www.pobox.com/~japhy/[/url]
    RPI Acacia brother #734 [url]http://www.perlmonks.org/[/url] [url]http://www.cpan.org/[/url]
    <stu> what does y/// stand for? <tenderpuss> why, yansliterate of course.
    [ I'm looking for programming work. If you like my work, let me know. ]

    Jeff 'Japhy' Pinyan Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139