The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

extractuse - determine what Perl modules are used in a given file

VERSION

Version 1.0 ($Id: extractuse 6744 2009-04-29 14:32:07Z FREQUENCY@cpan.org $)

SYNOPSIS

Usage: extractuse filename [...]

Given a single path referring to a file containing Perl code, this script will determine the modules included statically. This means that files included by use and require will be retrieved and listed.

DESCRIPTION

This script is safe because the Perl code is never executed, only parsed by Module::Extract::Use or Module::ExtractUse, which are two different implementations of this idea. This module will prefer Module::Extract::Use if it is installed, because it uses PPI to do its parsing, rather than its own separate grammar.

However, one limitation of this script is that only statically included modules can be found - that is, they have to be use'd or require'd at runtime, and not inside an eval string, for example. Because eval strings are completely dynamic, there is no way of determining which modules might be loaded under different conditions.

AUTHOR

Jonathan Yu <frequency@cpan.org>

SUPPORT

For support details, please look at perldoc Module::Extract::Use or perldoc Module::ExtractUse and use the corresponding support methods.

LICENSE

Copyleft (C) 2009 by Jonathan Yu <frequency@cpan.org>. All rights reversed.

I, the copyright holder of this script, hereby release the entire contents therein into the public domain. This applies worldwide, to the extent that it is permissible by law.

In case this is not legally possible, I grant any entity the right to use this work for any purpose, without any conditions, unless such conditions are required by law. If not applicable, you may use this script under the same terms as Perl itself.

SEE ALSO

Module::Extract::Use, Module::ExtractUse, Module::ScanDeps,