document updated a day ago, on Mar 12, 2025
IMHO, Devel::DumpTrace is one of the best of the various trace tools.
sending trace to a log file
DUMPTRACE_FH=/tmp/dumptrace perl -d:DumpTrace ....
viewing logs in Vim ($Devel::DumpTrace::TRACE == 3)
:set nowrap " needed because some lines get OBNOXIOUSLY long
:match IncSearch /^[^>].*/ " make it easy to distinguish between DumpTrace lines and non
:" conceal
:syntax match NonText "^.\{-}:\d\+:\[[^\]]*\]:" conceal
:set conceallevel=2
:set concealcursor=nc " concealed text is hidden, except for in visual mode
workaround for bug
When you try to load 'Devel::DumpTrace', then load and use 'DB_File', you get the error message:
DB_File::BTREEINFO does not define the method FIRSTKEY at /usr/local/share/perl5/Devel/DumpTrace.pm line 634.
A quick but non-functional workaround for this is to add this to your main script:
use DB_File;
BEGIN {
# Silence the error "DB_File::BTREEINFO does not define the method FIRSTKEY" when using
# Devel::DumpTrace, even though we don't actually fix the problem.
*DB_File::HASHINFO::FIRSTKEY = *DB_File::HASHINFO::NEXTKEY = sub { };
}