.\" Automatically generated by Pod::Man 4.11 (Pod::Simple 3.35) .\" .\" 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 >0, 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 .\" ======================================================================== .\" .IX Title "Find 3pm" .TH Find 3pm "2019-12-26" "perl v5.30.0" "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 Vö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. .IP "0.13, 2015\-03\-09" 8 .IX Item "0.13, 2015-03-09" This release contains two contributions from Moritz Lenz: .Sp Link to Module::Pluggable and Class::Factory::Util in \*(L"\s-1SEE ALSO\*(R"\s0 .Sp Align package name parsing with how perl does it (allowing single quotes as module separator) .Sp Also, added a test for meta.yml .IP "0.14, 2019\-12\-25" 8 .IX Item "0.14, 2019-12-25" A long overdue update. Thank you for the many contributions! .Sp Fixed RT#99055: Removed file readability check (pull request contributed by Moritz Lenz) .Sp Now supports \f(CW@INC\fR hooks (pull request contributed by Graham Knop) .Sp Now filters out filenames starting with a dot (pull request contributed by Desmond Daignault) .Sp Now uses strict (pull request contributed by Shlomi Fish) .Sp Fixed RT#122016: test/ files show up in metacpan (bug report contributed by Karen Etheridge) .IP "0.15, 2019\-12\-26" 8 .IX Item "0.15, 2019-12-26" Fixed RT#127657 (bug report contributed by Karen Etheridge): Module::Find now uses \f(CW@ModuleDirs\fR (if specified) for loading modules. Previously, when using \fBsetmoduledirs()\fR to set an array of directories that did not contain \f(CW@INC\fR, Module::Find would find the modules correctly, but load them from \f(CW@INC\fR. .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, Module::Pluggable, Class::Factory::Util .SH "AUTHOR" .IX Header "AUTHOR" Christian Renz, .SH "COPYRIGHT AND LICENSE" .IX Header "COPYRIGHT AND LICENSE" Copyright 2004\-2019 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.