Devel::TraceDeps::Scan - frontend and data access
my $scan = Devel::TraceDeps::Scan->load($filehandle);
my $scan = Devel::TraceDeps::Scan->scan(file => $filename, %opts);
$source may be a filename, or a reference to an open filehandle or string.
$source
my $scan = Devel::TraceDeps::Scan->load($source);
The list of all packages which called use(), require(), or do().
my @callers = $scan->callers;
Return all of the use/require/do events.
my @items = $scan->items;
Return all of the use/require/do events for a given package.
my @items_for = $scan->items_for($caller);
A unique list of use/require/do items.
my @required = $scan->required;
Everything from required() which did not fail to load.
my @loaded = $scan->loaded;
Devel::TraceDeps::Scan::Item objects are returned by several of the above methods. The have the following attributes:
Devel::TraceDeps::Scan::Item
The package which required this item (caller).
A string of sequence numbers indicating the tree of this call.
Filename from caller().
Line number from caller().
The require()d module filename (as found in keys %INC -- e.g. 'use Foo::Bar' would appear as 'Foo/Bar.pm'.)
keys %INC
This will typically be a relative path (within @INC), but might be absolute or ever relative to './' (depending on how use/require/do was called.
Item is a requirement for a minimum perl version. If 'req' is empty, look here.
The argument to do("filename").
True if the require() failed. This probably means that the file does not exist (e.g. eval {require thing} or do("whatever"))
eval {require thing}
do("whatever")
Any $@ or $! found.
Eric Wilhelm @ <ewilhelm at cpan dot org>
http://scratchcomputing.com/
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 (C) 2008 Eric L. Wilhelm, All Rights Reserved.
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.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install Devel::TraceDeps, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Devel::TraceDeps
CPAN shell
perl -MCPAN -e shell install Devel::TraceDeps
For more information on module installation, please visit the detailed CPAN module installation guide.