Module::Find3pm
Find and use installed modules in a (sub)category
Usage
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 defaultuse Module::Find qw(ignoresymlinks followsymlinks);# ignore symlinksignoresymlinks();# follow symlinks (default)followsymlinks();
Overview
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.
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 @INC before you call the Module::Find functions.
Functions
- setmoduledirs(@directories)
-
Sets the directories to be searched for modules. If not set, Module::Find will use
@INC. If you use this function,@INCwill not be included automatically, so add it if you want it. Set to undef to revert to default behaviour.
- "@found = findsubmod Module::Category"
-
Returns modules found in the Module/Category subdirectories of your perl installation. E.g.
"findsubmod CGI"will return"CGI::Session", but not"CGI::Session::File".
- "@found = findallmod Module::Category"
-
Returns modules found in the Module/Category subdirectories of your perl installation. E.g.
"findallmod CGI"will return"CGI::Session"and also"CGI::Session::File".
- "@found = usesub Module::Category"
-
Uses and returns modules found in the Module/Category subdirectories of your perl installation. E.g.
"usesub CGI"will return"CGI::Session", but not"CGI::Session::File".If any module dies during loading, usesub will also die at this point.
- "@found = useall Module::Category"
-
Uses and returns modules found in the Module/Category subdirectories of your perl installation. E.g.
"useall CGI"will return"CGI::Session"and also"CGI::Session::File".If any module dies during loading, useall will also die at this point.
- ignoresymlinks()
-
Do not follow symlinks. This function is not exported by default.
- followsymlinks()
-
Follow symlinks (default behaviour). This function is not exported by default.
Development notes
The development repository for this module is hosted on GitHub: <http://github.com/crenz/Module-Find/>. Please report any bugs by opening an issue there.
Copyright and license
Copyright 2004-2025 by Christian Renz <[email protected]>. All rights reserved.
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
Releases
11 releases since Debian 4.0 (Etch); the text changed 9 times.