.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
.de Sp \" Vertical space (when we can't use .PP)
.if t .sp .5v
.if n .sp
..
.de Vb \" Begin verbatim text
.ft CW
.nf
.ne \\$1
..
.de Ve \" End verbatim text
.ft R
.fi
..
.\" Set up some character translations and predefined strings. \*(-- will
.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
.\" double quote, and \*(R" will give a right double quote. \*(C+ will
.\" give a nicer C++. Capital omega is used to do unbreakable dashes and
.\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff,
.\" nothing in troff, for use with C<>.
.tr \(*W-
.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
.ie n \{\
. ds -- \(*W-
. ds PI pi
. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch
. ds L" ""
. ds R" ""
. ds C` ""
. ds C' ""
'br\}
.el\{\
. ds -- \|\(em\|
. ds PI \(*p
. ds L" ``
. ds R" ''
. ds C`
. ds C'
'br\}
.\"
.\" Escape single quotes in literal strings from groff's Unicode transform.
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.\"
.\" If the F register is turned on, we'll generate index entries on stderr for
.\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index
.\" entries marked with X<> in POD. Of course, you'll have to process the
.\" output yourself in some meaningful fashion.
.\"
.\" Avoid warning from groff about undefined register 'F'.
.de IX
..
.nr rF 0
.if \n(.g .if rF .nr rF 1
.if (\n(rF:(\n(.g==0)) \{
. if \nF \{
. de IX
. tm Index:\\$1\t\\n%\t"\\$2"
..
. if !\nF==2 \{
. nr % 0
. nr F 2
. \}
. \}
.\}
.rr rF
.\"
.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
.\" Fear. Run. Save yourself. No user-serviceable parts.
. \" fudge factors for nroff and troff
.if n \{\
. ds #H 0
. ds #V .8m
. ds #F .3m
. ds #[ \f1
. ds #] \fP
.\}
.if t \{\
. ds #H ((1u-(\\\\n(.fu%2u))*.13m)
. ds #V .6m
. ds #F 0
. ds #[ \&
. ds #] \&
.\}
. \" simple accents for nroff and troff
.if n \{\
. ds ' \&
. ds ` \&
. ds ^ \&
. ds , \&
. ds ~ ~
. ds /
.\}
.if t \{\
. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u"
. ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
.\}
. \" troff and (daisy-wheel) nroff accents
.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
.ds 8 \h'\*(#H'\(*b\h'-\*(#H'
.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
.ds ae a\h'-(\w'a'u*4/10)'e
.ds Ae A\h'-(\w'A'u*4/10)'E
. \" corrections for vroff
.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
. \" for low resolution devices (crt and lpr)
.if \n(.H>23 .if \n(.V>19 \
\{\
. ds : e
. ds 8 ss
. ds o a
. ds d- d\h'-1'\(ga
. ds D- D\h'-1'\(hy
. ds th \o'bp'
. ds Th \o'LP'
. ds ae ae
. ds Ae AE
.\}
.rm #[ #] #H #V #F C
.\" ========================================================================
.\"
.IX Title "Find 3pm"
.TH Find 3pm "2014-02-06" "perl v5.18.2" "User Contributed Perl Documentation"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
.nh
.SH "NAME"
Module::Find \- Find and use installed modules in a (sub)category
.SH "SYNOPSIS"
.IX Header "SYNOPSIS"
.Vb 1
\& use Module::Find;
\&
\& # use all modules in the Plugins/ directory
\& @found = usesub Mysoft::Plugins;
\&
\& # use modules in all subdirectories
\& @found = useall Mysoft::Plugins;
\&
\& # find all DBI::... modules
\& @found = findsubmod DBI;
\&
\& # find anything in the CGI/ directory
\& @found = findallmod CGI;
\&
\& # set your own search dirs (uses @INC otherwise)
\& setmoduledirs(@INC, @plugindirs, $appdir);
\&
\& # not exported by default
\& use Module::Find qw(ignoresymlinks followsymlinks);
\&
\& # ignore symlinks
\& ignoresymlinks();
\&
\& # follow symlinks (default)
\& followsymlinks();
.Ve
.SH "DESCRIPTION"
.IX Header "DESCRIPTION"
Module::Find lets you find and use modules in categories. This can be very
useful for auto-detecting driver or plugin modules. You can differentiate
between looking in the category itself or in all subcategories.
.PP
If you want Module::Find to search in a certain directory on your
harddisk (such as the plugins directory of your software installation),
make sure you modify \f(CW@INC\fR before you call the Module::Find functions.
.SH "FUNCTIONS"
.IX Header "FUNCTIONS"
.ie n .IP """setmoduledirs(@directories)""" 4
.el .IP "\f(CWsetmoduledirs(@directories)\fR" 4
.IX Item "setmoduledirs(@directories)"
Sets the directories to be searched for modules. If not set, Module::Find
will use \f(CW@INC\fR. If you use this function, \f(CW@INC\fR will \fInot\fR be included
automatically, so add it if you want it. Set to undef to revert to
default behaviour.
.ie n .IP """@found = findsubmod Module::Category""" 4
.el .IP "\f(CW@found = findsubmod Module::Category\fR" 4
.IX Item "@found = findsubmod Module::Category"
Returns modules found in the Module/Category subdirectories of your perl
installation. E.g. \f(CW\*(C`findsubmod CGI\*(C'\fR will return \f(CW\*(C`CGI::Session\*(C'\fR, but
not \f(CW\*(C`CGI::Session::File\*(C'\fR .
.ie n .IP """@found = findallmod Module::Category""" 4
.el .IP "\f(CW@found = findallmod Module::Category\fR" 4
.IX Item "@found = findallmod Module::Category"
Returns modules found in the Module/Category subdirectories of your perl
installation. E.g. \f(CW\*(C`findallmod CGI\*(C'\fR will return \f(CW\*(C`CGI::Session\*(C'\fR and also
\&\f(CW\*(C`CGI::Session::File\*(C'\fR .
.ie n .IP """@found = usesub Module::Category""" 4
.el .IP "\f(CW@found = usesub Module::Category\fR" 4
.IX Item "@found = usesub Module::Category"
Uses and returns modules found in the Module/Category subdirectories of your perl
installation. E.g. \f(CW\*(C`usesub CGI\*(C'\fR will return \f(CW\*(C`CGI::Session\*(C'\fR, but
not \f(CW\*(C`CGI::Session::File\*(C'\fR .
.Sp
If any module dies during loading, usesub will also die at this point.
.ie n .IP """@found = useall Module::Category""" 4
.el .IP "\f(CW@found = useall Module::Category\fR" 4
.IX Item "@found = useall Module::Category"
Uses and returns modules found in the Module/Category subdirectories of your perl installation. E.g. \f(CW\*(C`useall CGI\*(C'\fR will return \f(CW\*(C`CGI::Session\*(C'\fR and also
\&\f(CW\*(C`CGI::Session::File\*(C'\fR .
.Sp
If any module dies during loading, useall will also die at this point.
.ie n .IP """ignoresymlinks()""" 4
.el .IP "\f(CWignoresymlinks()\fR" 4
.IX Item "ignoresymlinks()"
Do not follow symlinks. This function is not exported by default.
.ie n .IP """followsymlinks()""" 4
.el .IP "\f(CWfollowsymlinks()\fR" 4
.IX Item "followsymlinks()"
Follow symlinks (default behaviour). This function is not exported by default.
.SH "HISTORY"
.IX Header "HISTORY"
.IP "0.01, 2004\-04\-22" 8
.IX Item "0.01, 2004-04-22"
Original version; created by h2xs 1.22
.IP "0.02, 2004\-05\-25" 8
.IX Item "0.02, 2004-05-25"
Added test modules that were left out in the first version. Thanks to
Stuart Johnston for alerting me to this.
.IP "0.03, 2004\-06\-18" 8
.IX Item "0.03, 2004-06-18"
Fixed a bug (non-localized \f(CW$_\fR) by declaring a loop variable in use functions.
Thanks to Stuart Johnston for alerting me to this and providing a fix.
.Sp
Fixed non-platform compatibility by using File::Spec.
Thanks to brian d foy.
.Sp
Added setmoduledirs and updated tests. Idea shamelessly stolen from
\&...errm... inspired by brian d foy.
.IP "0.04, 2005\-05\-20" 8
.IX Item "0.04, 2005-05-20"
Added \s-1POD\s0 tests.
.IP "0.05, 2005\-11\-30" 8
.IX Item "0.05, 2005-11-30"
Fixed issue with bugfix in PathTools\-3.14.
.IP "0.06, 2008\-01\-26" 8
.IX Item "0.06, 2008-01-26"
Module::Find now won't report duplicate modules several times anymore (thanks to Uwe Vo\*:lker for the report and the patch)
.IP "0.07, 2009\-09\-08" 8
.IX Item "0.07, 2009-09-08"
Fixed RT#38302: Module::Find now follows symlinks by default (can be disabled).
.IP "0.08, 2009\-09\-08" 8
.IX Item "0.08, 2009-09-08"
Fixed RT#49511: Removed Mac \s-1OS X\s0 extended attributes from distribution
.IP "0.09, 2010\-02\-26" 8
.IX Item "0.09, 2010-02-26"
Fixed RT#38302: Fixed \s-1META\s0.yml generation (thanks very much to cpanservice for the help).
.IP "0.10, 2010\-02\-26" 8
.IX Item "0.10, 2010-02-26"
Fixed RT#55010: Removed Unicode \s-1BOM\s0 from Find.pm.
.IP "0.11, 2012\-05\-22" 8
.IX Item "0.11, 2012-05-22"
Fixed RT#74251: defined(@array) is deprecated under Perl 5.15.7.
Thanks to Roman F, who contributed the implementation.
.IP "0.12, 2014\-02\-08" 8
.IX Item "0.12, 2014-02-08"
Fixed RT#81077: useall fails in taint mode
Thanks to Aran Deltac, who contributed the implementation and test.
.Sp
Fixed RT#83596: Documentation doesn't describe behaviour if a module fails to load
Clarified documentation for useall and usesub.
.Sp
Fixed RT#62923: setmoduledirs(undef) doesn't reset to searching \f(CW@INC\fR
Added more explicit tests.
Thanks to Colin Robertson for his input.
.SH "DEVELOPMENT NOTES"
.IX Header "DEVELOPMENT NOTES"
Please report any bugs using the \s-1CPAN RT\s0 system. The development repository for this module is hosted on GitHub: .
.SH "SEE ALSO"
.IX Header "SEE ALSO"
perl
.SH "AUTHOR"
.IX Header "AUTHOR"
Christian Renz,
.SH "COPYRIGHT AND LICENSE"
.IX Header "COPYRIGHT AND LICENSE"
Copyright 2004\-2014 by Christian Renz . All rights reserved.
.PP
This library is free software; you can redistribute it and/or modify
it under the same terms as Perl itself.