NAME
App::tracepm - Trace dependencies of your Perl script
VERSION
This document describes version 0.13 of App::tracepm (from Perl distribution App-tracepm), released on 2014-12-28.
SYNOPSIS
This distribution provides command-line utility called tracepm.
FUNCTIONS
tracepm(%args) -> [status, msg, result, meta]
Trace dependencies of your Perl script.
Arguments ('*' denotes required arguments):
args => array
Script arguments.
cache_prereqscanner => bool (default: 0)
Whether cache Perl::PrereqScanner{,::Lite} result.
core => bool
Filter only modules that are in core.
detail => bool (default: 0)
Whether to return records instead of just module names.
eval => str
Specify script from command-line instead.
method => str (default: "fatpacker")
Tracing method to use.
There are several tracing methods that can be used:
fatpacker
(the default): This method uses the same method thatfatpacker trace
uses, which is running the script usingperl -c
then collect the populated%INC
. Only modules loaded during compile time are detected.require
: This method runs your script normally until it exits. At the start of program, it replacesCORE::GLOBAL::require()
with a routine that logs the require() argument to the log file. Modules loaded during runtime is also logged by this method. But some modules might not work, specifically modules that also overrides require() (there should be only a handful of modules that do this though).prereqscanner
: This method does not run your Perl program, but statically analyze it usingPerl::PrereqScanner
. Since it usesPPI
, it can be rather slow.prereqscanner_recurse
: Likeprereqscanner
, but will recurse into all non-core modules until they are exhausted. Modules that are not found will be skipped. It is recommended to use the variousrecurse_exclude_*
options options to limit recursion.prereqscanner_lite
: This method is like theprereqscanner
method, but instead ofPerl::PrereqScanner
it usesPerl::PrereqScanner::Lite
. The latter does not usePPI
but useCompiler::Lexer
which is significantly faster.prereqscanner_lite_recurse
: Likeprereqscanner_lite
, but recurses.
perl_version => str
Perl version, defaults to current running version.
This is for determining which module is core (the list differs from version to version. See Module::CoreList for more details.
recurse_exclude => array
When recursing, exclude some modules.
recurse_exclude_core => bool
When recursing, exclude core modules.
recurse_exclude_pattern => array
When recursing, exclude some module patterns.
recurse_exclude_xs => bool
When recursing, exclude XS modules.
script => str
Path to script file (script to be packed).
use => array
Additional modules to "use".
This is like running:
perl -MModule1 -MModule2 script.pl
xs => bool
Filter only modules that are XS modules.
Return value:
Returns an enveloped result (an array).
First element (status) is an integer containing HTTP status code (200 means OK, 4xx caller error, 5xx function error). Second element (msg) is a string containing error message, or 'OK' if status is 200. Third element (result) is optional, the actual result. Fourth element (meta) is called result metadata and is optional, a hash that contains extra information.
(any)
TODO
'use' args not yet respected if 'method' =~ /prereqscanner/
Option to silent STDOUT and/or STDERR output of script.
HOMEPAGE
Please visit the project's homepage at https://metacpan.org/release/App-tracepm.
SOURCE
Source repository is at https://github.com/sharyanto/perl-App-tracepm.
BUGS
Please report any bugs or feature requests on the bugtracker website https://rt.cpan.org/Public/Dist/Display.html?Name=App-tracepm
When submitting a bug or request, please include a test-file or a patch to an existing test-file that illustrates the bug or desired feature.
AUTHOR
perlancar <perlancar@cpan.org>
COPYRIGHT AND LICENSE
This software is copyright (c) 2014 by perlancar@cpan.org.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.