Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I monitor the Perl call stack?

Tags:

callstack

perl

I'm using ActivePerl 5.8 on Windows XP.

use strict;
use warnings;
use Data::Dumper;

There are three subroutines used in my script.

To detect the call stack, I can only insert some print "some location"; and check the print result from console Window.

Is there any good method to monitor it? Thank you.

like image 503
Nano HE Avatar asked Jan 08 '10 01:01

Nano HE


People also ask

How do you read a call stack?

Call stack is set of lines, which is usually read from top to bottom - meaning moving from current locations to callers. The bottom line was executed first. The top line is executed last and it is the current routine.

What is the difference between call stack and stack trace?

A call stack is typically "the current stack of operations" - i.e. while it's running. A stack trace is typically a copy of the call stack which is logged at some sort of failure, e.g. an exception.

What is call stack space?

A "stack," or stack space, is a block of memory used to store temporary data needed for proper program execution.


1 Answers

If it's your code, you might want to use:

Carp::cluck( "And here's the stack:" );

See Carp::cluck. It prints out a warning with a stack trace. It works like the "printf" style of debug output.

like image 56
Axeman Avatar answered Nov 05 '22 17:11

Axeman