Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Contact Us
Online Help
Domain Status
Man Pages

Virtual Servers

Topology Map

Server Agreement
Year 2038

USA Flag



Man Pages

Manual Reference Pages  -  DEVEL::TRACEUSE (3)

.ds Aq ’


Devel::TraceUse - show the modules your program loads, recursively



An apparently simple program may load a lot of modules. That’s useful, but sometimes you may wonder exactly which part of your program loads which module.

Devel::TraceUse can analyze a program to see which part used which module. I recommend using it from the command line:

  $ perl -d:TraceUse

This will display a tree of the modules ultimately used to run your program. (It also runs your program with only a little startup cost all the way through to the end.)

  Modules used from
     1.  strict 1.04, line 1 [main]
     2.  warnings 1.06, line 2 [main]
     3.  Getopt::Long 2.37, line 3 [main]
     4.    vars 1.01, Getopt/ line 37
     5.      warnings::register 1.01, line 7
     6.    Exporter 5.62, Getopt/ line 43
     9.      Exporter::Heavy 5.62, line 18
     7.    constant 1.13, Getopt/ line 226
     8.    overload 1.06, Getopt/ line 1487 [Getopt::Long::CallBack]

The load order is listed on the first column. The version is displayed after the module name, if available. The calling package is shown between square brackets if different from the package that can be inferred from the file name. Extra information is also provided if the module was loaded from within and eval.

Devel::TraceUse will also report modules that failed to be loaded, under the modules that tried to load them.

In the very rare case when Devel::TraceUse is not able to attach a loaded module to the tree, it will be reported at the end.

Even though using -MDevel::TraceUse is possible, it is preferable to use -d:TraceUse, as the debugger will provide more accurate information. You will be reminded in the output.

If you want to know only the modules loaded during the compile phase, use the standard -c option of perl (see perlrun):

  $ perl -c -d:TraceUse


You can hide the core modules that your program used by providing parameters at use time:

  $ perl -d:TraceUse[=<option1>:<value1>[,<option2>:<value2>[...]]]


  $ perl -d:TraceUse=hidecore

This will not renumber the modules so the core module’s positions will be visible as gaps in the numbering. In some cases evidence may also be visible of the core module’s usage (e.g. a caller shown as base or parent).

You may also specify the version of Perl for which you want to hide the core modules (the default is the running version):

  $ perl -d:TraceUse=hidecore:5.8.1

The version string can be given as x.yyy.zzz (dot-separated) or x.yyyzzz (decimal). For example, the strings 5.8.1, 5.08.01, 5.008.001 and 5.008001 will all represent Perl version 5.8.1, and 5.5.30, 5.005_03 will all represent Perl version 5.005_03.


  $ perl -d:TraceUse=output=out.txt

This will output the TraceUse result to the given file instead of warn.

Note that TraceUse warnings will still be output as warnings.

The output file is opened at initialization time, so there should be no surprise in relative path interpretation even if your program changes the current directory.


chromatic, <chromatic at>

Philippe Bruhat, <book at>


hidecore option contributed by David Leadbeater, <>.

output option contributed by Olivier Mengue\k:'(<>).

perl -c support contributed by Olivier Mengue\k:'(<>).


Please report any bugs or feature requests to bug-devel-traceuse at, or through the web interface at <>. We can both track it there.


You can find documentation for this module with the perldoc command.

    perldoc Devel::TraceUse

You can also look for information at:
o Perl Hacks, hack #74

O’Reilly Media, 2006.

o AnnoCPAN: Annotated CPAN documentation


o CPAN Ratings


o RT: CPAN’s request tracker


o Search CPAN



Copyright 2006 chromatic, most rights reserved.

Copyright 2010-2012 Philippe Bruhat (BooK), for the rewrite.


This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
Search for    or go to Top of page |  Section 3 |  Main Index

perl v5.20.3 DEVEL::TRACEUSE (3) 2016-03-17

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.