Devel::CallTrace(3pm)

Devel::CallTrace3pm

See what your code's doing

Usage

#!/usr/bin/perl -d:CallTrace

package foo;

sub bar {
print "bar\n";
baz(); }

sub baz {
print "boo\n"; }

foo::bar();

Rationale

There are a number of perl modules in the CPAN that are designed to trace a program's execution as it runs. Each uses a different trick to do its job, but none of them quite met my needs. The technique this module uses is quite simple and seems to be quite robust.

DB::sub

perl will automatically call DB::sub on each subroutine call and leave it up to us to dispatch to where we want to go.

Devel::CallTrace::called

This routine is called with two parameters:

DEPTH

The integer "depth" that this call is being called at.

PARAMS

A reference to the routine's @INC

To get at the subroutine that was being called, have a look at $DB::sub

Releases

7 releases since Debian 7 (Wheezy); the text changed 3 times.

  1. 7–9
  2. 10
  3. 11
  4. 12–13

Bugs

It uses the debugger. How could it not have bugs?

From libdevel-calltrace-perl 1.2-3 in Debian 13 (Trixie). Parsed by carta from the page's man source.