The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Devel::TraceDeps - track loaded modules and objects

SYNOPSIS

  $ perl -MDevel::TraceDeps your_program.pl

And the real fun is to pull a tree of dependencies off of your test suite.

  $ perl -MDevel::eps=tree -S prove -l -r t
  $ ls tracedeps/

And of course no Devel:: module would be complete without an obligatory cute little shortcut which needlessly involves the DB backend:

  $ perl -d:eps whatever.pl

TODO: a cute little shortcut which needlessly claims an otherwise very funny-looking toplevel namespace.

  $ perl -MapDeps whatever.pl

About

Devel::TraceDeps delivers a comprehensive report of everything which was loaded into your perl process via the use, require, or do($file) mechanisms.

Unlike Devel::TraceLoad, it does load any modules itself and is intended to be very unintrusive. Unlike Module::ScanDeps, it is designed to run alongside your test suite.

For access to the resultant data, see the API in Devel::TraceDeps::Scan.

In tree mode, forking processes and various other runtime effects should be supported -- tests and patches welcome.

TODO reports on shared objects loaded by DynaLoader/XSLoader.

Possible Issues

I think these are going to be very pathological cases since I've already run a fair body of code through this without any visible hitches.

Version Number Ambiguity

If you try to require("5.whatever.pm"), it might fail.

Caller

If a required module expects to do something with caller() at BEGIN time (e.g. outside of import()), we have problems. If I could think of a good reason to rewrite the results of caller(), I would.

Tree

The tree setting goes all the way down into any perl subprocesses by setting ourselves in PERL5OPT. This is probably what you want if you're trying to package or bundle some code, but needs a knob if you're trying to do something else with it.

The PERL5OPT variable gets dropped if you use taint. Patches welcome!

AUTHOR

Eric Wilhelm @ <ewilhelm at cpan dot org>

http://scratchcomputing.com/

BUGS

If you found this module on CPAN, please report any bugs or feature requests through the web interface at http://rt.cpan.org. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.

If you pulled this development version from my /svn/, please contact me directly.

COPYRIGHT

Copyright (C) 2008 Eric L. Wilhelm, All Rights Reserved.

NO WARRANTY

Absolutely, positively NO WARRANTY, neither express or implied, is offered with this software. You use this software at your own risk. In case of loss, no person or entity owes you anything whatsoever. You have been warned.

LICENSE

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.