How to get "subroutine call depth watermark"?

K

kj

Is there a way for me to determine the "subroutine call depth
watermark" for a particular run of a Perl program? By this I mean
the greatest depth of subroutine calls attained by the program
during its execution.

A second best would be a similar watermark for the size of the perl
argument stack.

I don't know much about how perl manages the space allocated to
its stacks, but if it never shrinks this space once it is allocated,
then a third best would be the amount of memory allocated to the
argument stack at the time the program terminates.

Thanks!

kj

P.S. By "depth" I mean the same as what the error message in the
*very contrived* example below means:

main::(-e:1): 42
DB<1> sub foo{ foo() }
DB<2> foo
main::foo((eval 4)[/opt/lib/perl5/5.8.3/perl5db.pl:619]:2):
2: sub foo{ foo() };
100 levels deep in subroutine calls!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top