Module::PrintUsed - Prints modules used by your script when your script ends


Module-PrintUsed documentation  | view source Contained in the Module-PrintUsed distribution.

Index


SYNOPSIS

Top

  use Module::PrintUsed;

DESCRIPTION

Top

This module helps you to check which modules (and scripts) were used or required during the runtime of your script. It prints the list of modules to STDERR, including version numbers and paths.

Module::PrintUsed contains an END {} block that will be executed when your script exits (even if it died).

USAGE VIA PERL5OPT

It is possible to print a list of modules used even without modifying your perl scripts or programs. To achieve this, set the PERL5OPT environment variable to "-MModule::PrintUsed".

Unix command-line example:

    env PERL5OPT=-MModule::PrintUsed perl myscript.pl

Windows command-line example:

    set PERL5OPT=-MModule::PrintUsed
    perl myscript.pl

FUNCTIONS

Top

Module::PrintUsed::ModulesList()

Returns a list of modules used in the format

    @modules = ({name => 'Some::Module', version => '0.1',
                 path => '/home/thisuser/lib/Some/Module.pm'}, ...);

Module::PrintUsed::FormattedModulesList()

Returns a scalar that contains a pretty-printed version of the modules list.

DEVELOPMENT NOTES

Top

Please report any bugs sing the CPAN RT system. The development repository for this module is hosted on GitHub: http://github.com/crenz/Module-PrintUsed/.

THANKS

Top

Thanks to Slaven Rezić for pointing out that Module::PrintUsed can be used with the PERL5OPT environment variable, and for alerting me to warnings caused by autosplitted modules.

SEE ALSO

Top

A more sophisticated way of finding module dependencies without having to execute the script is performed by Module::ScanDeps.

AUTHOR

Top

Christian Renz, <crenz @ web42.com>

COPYRIGHT AND LICENSE

Top


Module-PrintUsed documentation  | view source Contained in the Module-PrintUsed distribution.