Devel::CallTrace(3pm)
โจ NAME โจ
Devel::CallTrace โ bestie, it's literally See what your code's doing ๐ no cap, that's the whole vibe
๐ SYNOPSIS ๐
okay so this is the whole setup, look:
#!/usr/bin/perl -d:CallTrace
package foo;
sub bar {
print "bar\n";
baz(); }
sub baz {
print "boo\n"; }
foo::bar();
that -d:CallTrace on the shebang line? that's the moment. that's the โจmain character momentโจ ๐ซถ
๐ RATIONALE ๐
so like, there are a bunch of perl modules on CPAN that are all about tracing a program's execution as it runs. every single one of them uses a different lil trick to do its job, and honestly? none of them quite met my needs. ๐
the technique this module uses is pretty simple, and lowkey it seems to be quite robust. it's giving "elegant", it's giving "it just works".
๐ธ DB::sub ๐ธ
perl will automatically call DB::sub on each subroutine call, and then it's justโฆ up to us to dispatch to wherever we wanna go. that's it. that's the whole trick. ๐โจ
๐ฆ Devel::CallTrace::called ๐ฆ
this routine gets called with two parameters, and you need to know both:
- DEPTH โ the integer "depth" that this call is being called at. ๐
- PARAMS โ a reference to the routine's
@INC
and to get at the subroutine that was being called? go look at $DB::sub. that's where the tea is. ๐
๐ญ BUGS ๐ญ
it uses the debugger. bestie. how could it not have bugs?? ๐
๐ SEE ALSO ๐
perldebgutsDB- a licensed therapist ๐ซถ (no fr, you're gonna want one)
also these legends:
traceโ uses source filters. scares me. ๐Devel::TraceCallsโ very robust API. the code seems to do all sorts of scary magic ๐ฎDebug::Traceโ uses symbol table magic to wrap your functions โจDevel::TRaceFuncsโ requires developers to instrument their source files ๐
๐ COPYRIGHT ๐
Copyright 2005 Jesse Vincent <jesse@bestpractical.com>
This module may be redistributed under the same terms as perl itself.
and that's a wrap, angel ๐ this whole page came to you from perl v5.36.0, dated 2022-12-04, and it's filed under Devel::CallTrace(3pm). go trace something iconic, ily ๐๐ฆโญ
๐ฆ where this page comes from
- debian bookworm: libdevel-calltrace-perl 1.2-3 ยท Artistic-1.0-Perl OR GPL-1.0-or-later
- debian trixie: libdevel-calltrace-perl 1.2-3 ยท Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: libdevel-calltrace-perl 1.2-3 ยท Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libdevel-calltrace-perl 1.2-3 ยท Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libdevel-calltrace-perl 1.2-3 ยท Artistic-1.0-Perl OR GPL-1.0-or-later
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms