NAME

Devel::TraceDeps::Scan - frontend and data access

SYNOPSIS

my $scan = Devel::TraceDeps::Scan->load($filehandle);

Acquisition

scan

my $scan = Devel::TraceDeps::Scan->scan(file => $filename, %opts);

Retrieval

load

$source may be a filename, or a reference to an open filehandle or string.

my $scan = Devel::TraceDeps::Scan->load($source);

Querying the Data

callers

The list of all packages which called use(), require(), or do().

my @callers = $scan->callers;

items

Return all of the use/require/do events.

my @items = $scan->items;

items_for

Return all of the use/require/do events for a given package.

my @items_for = $scan->items_for($caller);

required

A unique list of use/require/do items.

my @required = $scan->required;

loaded

Everything from required() which did not fail to load.

my @loaded = $scan->loaded;

Item objects

Devel::TraceDeps::Scan::Item objects are returned by several of the above methods. The have the following attributes:

by

The package which required this item (caller).

trace

A string of sequence numbers indicating the tree of this call.

file

Filename from caller().

line

Line number from caller().

req

The require()d module filename (as found in keys %INC -- e.g. 'use Foo::Bar' would appear as 'Foo/Bar.pm'.)

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.

ver

Item is a requirement for a minimum perl version. If 'req' is empty, look here.

did

The argument to do("filename").

fail

True if the require() failed. This probably means that the file does not exist (e.g. eval {require thing} or do("whatever"))

err

Any $@ or $! found.

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.