|
/home/cpanrun/depot/main/contrib-patched/perl/CPAN/src/Devel-TraceSubs/blib/lib/Devel/TraceSubs.pm |
Devel::TraceSubs - Subroutine wrappers for debugging
This document describes version 0.02 of Devel::TraceSubs, released 22 June 2002.
package foo;
sub bar { print "foobar\n" }
package etc;
sub etc { etc::etc() }
package main; use Devel::TraceSubs;
sub foo { print "foo\n"; foo::bar() }
my $pkg = 'main::';
my $dbg = Devel::TraceSubs->new(
verbose => 0,
pre => '>',
post => '<',
level => '~',
params => 1,
wrap => ['<!--', '-->'],
);
$dbg->untraceables( 'etc::etc::' );
$dbg->trace(
'foo::', # valid
$pkg, # valid
'main', # invalid -- no trailing colons
'joe::', # invalid -- non-existant
$dbg, # invalid -- references not allowed
'Debug::SubWrap::', # invalid -- self-reference not allowed
*main::, # invalid -- globs not allowed
'etc::', # invalid -- untraceable
);
Devel::TraceSubs allows you to track the entry and exit of subroutines in a list of namespaces you specify. It will return the proper stack depth, and display parameters passed. Error checking prevents silent failures (err... the ones i know of.) It takes advantage of Hook::LexWrap to do the dirty work of wrapping the subs and return the proper caller context.
NOTE: Using verbose mode with wrap mode will generate a compile-time error. Don't do that!
ALSO NOTE: using level => '-' and pre=> '>' can cause problems with wrap => ['<!--', '-->']. Don't do that, either!
new()trace()untraceables()_stack_depth()_gen_wrapper()_warning()
None. Give a hoot, don't pollute!
Likely so. Not recommended for production use--but why on earth would you be using a Devel:: module in production?
particle <particle@artfromthemachine.com> Jenda <Jenda@Krynicky.cz>
Copyright 2002 - Ars Ex Machina, Corp.
This package is free software and is provided ``as is'' without express or implied warranty. It may be used, redistributed and/or modified under the terms of the Perl Artistic License (see http://www.perl.com/perl/misc/Artistic.html)
Address bug reports and comments to: particle@artfromthemachine.com. When sending bug reports, please provide the version of Devel::TraceSubs, the version of Perl, and the name and version of the operating system you are using.
Thanks to Jenda at perlmonks.org for the idea to to display passed parameters, and the patch to implement it. Thanks to crazyinsomniac at perlmonks.org for the idea to support html (or other) output formats.
|
/home/cpanrun/depot/main/contrib-patched/perl/CPAN/src/Devel-TraceSubs/blib/lib/Devel/TraceSubs.pm |