1Find(3) User Contributed Perl Documentation Find(3)
2
3
4
6 Module::Find - Find and use installed modules in a (sub)category
7
9 use Module::Find;
10
11 # use all modules in the Plugins/ directory
12 @found = usesub Mysoft::Plugins;
13
14 # use modules in all subdirectories
15 @found = useall Mysoft::Plugins;
16
17 # find all DBI::... modules
18 @found = findsubmod DBI;
19
20 # find anything in the CGI/ directory
21 @found = findallmod CGI;
22
23 # set your own search dirs (uses @INC otherwise)
24 setmoduledirs(@INC, @plugindirs, $appdir);
25
27 Module::Find lets you find and use modules in categories. This can be
28 very useful for auto-detecting driver or plugin modules. You can dif‐
29 ferentiate between looking in the category itself or in all subcate‐
30 gories.
31
32 If you want Module::Find to search in a certain directory on your hard‐
33 disk (such as the plugins directory of your software installation),
34 make sure you modify @INC before you call the Module::Find functions.
35
37 "setmoduledirs(@directories)"
38 Sets the directories to be searched for modules. If not set, Mod‐
39 ule::Find will use @INC. If you use this function, @INC will not be
40 included automatically, so add it if you want it. Set to undef to
41 revert to default behaviour.
42
43 "@found = findsubmod Module::Category"
44 Returns modules found in the Module/Category subdirectories of your
45 perl installation. E.g. "findsubmod CGI" will return "CGI::Ses‐
46 sion", but not "CGI::Session::File" .
47
48 "@found = findallmod Module::Category"
49 Returns modules found in the Module/Category subdirectories of your
50 perl installation. E.g. "findallmod CGI" will return "CGI::Session"
51 and also "CGI::Session::File" .
52
53 "@found = usesub Module::Category"
54 Uses and returns modules found in the Module/Category subdirecto‐
55 ries of your perl installation. E.g. "usesub CGI" will return
56 "CGI::Session", but not "CGI::Session::File" .
57
58 "@found = useall Module::Category"
59 Uses and returns modules found in the Module/Category subdirecto‐
60 ries of your perl installation. E.g. "useall CGI" will return
61 "CGI::Session" and also "CGI::Session::File" .
62
64 0.01, 2004-04-22
65 Original version; created by h2xs 1.22
66
67 0.02, 2004-05-25
68 Added test modules that were left out in the first version.
69 Thanks to Stuart Johnston for alerting me to this.
70
71 0.03, 2004-06-18
72 Fixed a bug (non-localized $_) by declaring a loop variable in
73 use functions. Thanks to Stuart Johnston for alerting me to
74 this and providing a fix.
75
76 Fixed non-platform compatibility by using File::Spec. Thanks
77 to brian d foy.
78
79 Added setmoduledirs and updated tests. Idea shamelessly stolen
80 from ...errm... inspired by brian d foy.
81
82 0.04, 2005-05-20
83 Added POD tests.
84
85 0.05, 2005-11-30
86 Fixed issue with bugfix in PathTools-3.14.
87
89 perl
90
92 Christian Renz, <crenz@web42.com>
93
95 Copyright 2004 by Christian Renz <crenz@web42.com>. All rights
96 reserved.
97
98 This library is free software; you can redistribute it and/or modify it
99 under the same terms as Perl itself.
100
101
102
103perl v5.8.8 2005-11-30 Find(3)