Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

pm_which(1p) [debian man page]

PM_WHICH(1p)						User Contributed Perl Documentation					      PM_WHICH(1p)

NAME
pm_which - find installed modules SYNOPSIS
pm_which [ options ] module(s) Returns the path to the given module(s) OPTIONS -q, --quiet Just print paths -p, --paths Just convert the module name into a relative path -a, --all Print all paths, not just the first one found -n, --namespace Print all modules in the given namespace -m Only print module names, not paths -V Show module version -I libpath Add a path to search (like perl -I) -d, --dump Dump paths that would be searched (@INC by default) -h, --help Print this message -v, --version Print version information - Read modules from stdin, one per line DESCRIPTION
This tool reports the locations of installed perl modules. By default it lists the location of each specified module that would be loaded by require. OPTION DETAILS
quiet Under quiet mode, module names are suppressed and missing modules are not reported. Normal output: $ pm_which Module::One Module::Two Missing::Module Module::One - /path/to/Module/One.pm Module::Two - /path/to/Module/Two.pm Missing::Module - not found Under --quiet: $ pm_which -q Module::One Module::Two Missing::Module /path/to/Module/One.pm /path/to/Module/Two.pm paths In "paths" mode, each module is simply converted into a relative file path. This is possible even when the module is not installed. $ pm_which -p Missing::Module Missing/Module.pm all When the "all" switch is specified, all installed modules will be reported, not just the first one. This is useful for determining when there is a module installed in multiple locations. $ pm_which -a MyModule /path/to/MyModule.pm /home/me/perl/MyModule.pm namespace Arguments are taken as namespaces to search under. $ pm_which -n MyModule MyModule - /path/to/MyModule.pm MyModule::Foo - /path/to/MyModule/Foo.pm MyModule::Foo::Bar - /path/to/MyModule/Foo/Bar.pm -m Disables printing of module paths. This is only really useful in conjunction with --namespace. $ pm_which -nm MyModule MyModule MyModule::Foo MyModule::Foo::Bar -V Prints the version of each module, according to ExtUtils::MakeMaker. $ pm_which -V MyModule MyModule - /path/to/MyModule.pm [ 1.00 ] $ pm_which -Vnm MyModule MyModule [ 1.00 ] MyModule::Foo [ 0.01 ] MyModule::Foo::Bar [ undef ] dump Dumps the paths that would be searched and exits. This is @INC modified by any -I switches. $ pm_which --dump /usr/lib/perl5/site_perl/5.8.6 /usr/lib/perl5/vendor_perl/5.8.6 ... $ pm_which -I lib --dump -I blib/lib lib blib/lib /usr/lib/perl5/site_perl/5.8.6 ... version Prints the version number of the script, plus the version and path of Module::Util that was loaded. EXIT CODES
o 0 - Everything was OK o 1 - Initialisation failed (bad switches?) o 2 - Some modules were not installed SEE ALSO
This utility comes with Module::Util. AUTHOR
Matt Lawrence <mattlaw@cpan.org> perl v5.14.2 2012-06-08 PM_WHICH(1p)

Check Out this Related Man Page

Module::Optional(3pm)					User Contributed Perl Documentation				     Module::Optional(3pm)

NAME
Module::Optional - Breaking module dependency chains SYNOPSIS
use Bar::Dummy qw(); use Module::Optional Bar; ABSTRACT
This module provides a way of using a module which may or may not be installed on the target machine. If the module is available it behaves as a straight use. If the module is not available, subs are repointed to their equivalents in a dummy namespace. DESCRIPTION
Suppose you are the developer of module "Foo", which uses functionality from the highly controversial module "Bar". You actually quite like "Bar", and want to reuse its functionality in your "Foo" module. But, many people will refuse to install "Foo" as it needs "Bar". Maybe "Bar" is failing tests or is misbehaving on some platforms. Making "Bar" an optional module will allow users to run "Foo" that don't have "Bar" installed. For Module::Build users, this involves changing the status of the "Bar" dependency from "requires" to "recommends". To use this module, you need to set up a namespace "Bar::Dummy". The recommended way of doing this is to ship lib/Bar/Dummy.pm with your module. This could be shipped as a standalone module. A dummy module for "Params::Validate" is shipped with Module::Optional, as this was the original motivation for the module. If there are other common candidates for dummying, petition me, and I'll include them in the Module::Optional distribution. Using an optional module Place the lines of code in the following order: use Bar::Dummy qw(); use Module::Optional qw(Bar quux wibble wobble); Always set up the dummy module first, but don't import anything - this is to avoid warnings about redefined subroutines if the real Bar is installed on the target machine. Module::Optional will do the importing: quux wibble and wobble from the real Bar if it exists, or from Bar::Dummy if it doesn't. Asking for a module version If you need a version of the module or later, this can be done thus: use Bar::Dummy qw(); use Module::Optional qw(Bar 0.07 quux wibble wobble); If version 0.07 or later of Bar is not available, the dummy is used. Suppressing the module You will probably be developing your module on a platform that does have Bar installed (I hope). However, you need to be able to tell what happens on systems without Bar. To do this, run the following (example is Unix): MODULE_OPTIONAL_SKIP=1 make test You also want to do this in tests for the dummy module that you are providing. (You are providing tests for this module?) This can easily be done with a begin block at the top of the test: BEGIN { local $ENV{MODULE_OPTIONAL_SKIP} = 1; use Module::Optional qw(Params::Validate); } Writing a ::Dummy Module You provide a namespace suffixed with ::Dummy containing subs corresponding to all the subs and method calls for the optional module. You should also provide the same exports as the module itself performs. Adhere strictly to any prototypes in the optional module. An example of a dummy module is Params::Validate::Dummy, provided in this distribution. INTERNALS
Module::Optional performs two types of redirection for the missing module. Firstly via @ISA inheritance - Foo::Bar inherits from Foo::Bar::Dummy. Secondly, an AUTOLOAD method is added to Foo::Bar, which will catch calls to subs in this namespace. BUGS
Please report bugs to rt.cpan.org by posting to bugs-module-optional@rt.cpan.org or visiting https://rt.cpan.org/Public/Dist/Display.html?Name=Module-Optional. AUTHOR
Ivor Williams ivorw-mod-opt at xemaps.com COPYRIGHT
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. The full text of the license can be found in the LICENSE file included with this module. SEE ALSO
Test::MockModule, Module::Pluggable, Module::Build. perl v5.10.1 2010-12-17 Module::Optional(3pm)
Man Page