Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Trace Perl Method Calls [closed]

Tags:

perl

I'm looking for a good Perl library that will trace method calls and dump them to a file as a program executes.

I know of Devel::Trace but it is quite limited and the output is super verbose.

Is there something better out there?

I'd like to be able to run something like the following from CLI.

perl -MTracer("My::Package::*", my_trace_file) my_large_modularized_program.pl

Ideally that would dump a list of method calls made in My::Package out to the file my_trace_file.

like image 475
evolution Avatar asked Apr 09 '26 03:04

evolution


2 Answers

I tried googling for "perl trace sub calls". The first two hits seem appropriate: Debug::Trace and Debug::LTrace.

like image 53
choroba Avatar answered Apr 12 '26 11:04

choroba


Use a profiler. Devel::NYTProf is pretty much defacto standard for that.

like image 44
Oleg V. Volkov Avatar answered Apr 12 '26 11:04

Oleg V. Volkov