package Devel::Ttrace; use strict; use warnings; use Time::HiRes qw[ time ]; require IO::Socket::INET; require threads; my $socket = IO::Socket::INET->new( 'localhost:54321' ); sub DB::DB { no warnings 'uninitialized'; my @caller = caller(1); printf $socket "%15.5f %5d(%3d) %s(%5s) %s: %s\n", time(), $$, threads->tid, @caller[ 1, 2, 3 ], 'n/a' ; } 1;