{
    "mode": "perldoc",
    "parameter": "ExtUtils::Installed",
    "section": "",
    "url": "https://www.chedong.com/phpMan.php/perldoc/ExtUtils%3A%3AInstalled/json",
    "generated": "2026-06-03T07:59:26Z",
    "synopsis": "use ExtUtils::Installed;\nmy ($inst) = ExtUtils::Installed->new( skipcwd => 1 );\nmy (@modules) = $inst->modules();\nmy (@missing) = $inst->validate(\"DBI\");\nmy $allfiles = $inst->files(\"DBI\");\nmy $filesbelowusrlocal = $inst->files(\"DBI\", \"all\", \"/usr/local\");\nmy $alldirs = $inst->directories(\"DBI\");\nmy $dirsbelowusrlocal = $inst->directorytree(\"DBI\", \"prog\");\nmy $packlist = $inst->packlist(\"DBI\");",
    "sections": {
        "NAME": {
            "content": "ExtUtils::Installed - Inventory management of installed modules\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "use ExtUtils::Installed;\nmy ($inst) = ExtUtils::Installed->new( skipcwd => 1 );\nmy (@modules) = $inst->modules();\nmy (@missing) = $inst->validate(\"DBI\");\nmy $allfiles = $inst->files(\"DBI\");\nmy $filesbelowusrlocal = $inst->files(\"DBI\", \"all\", \"/usr/local\");\nmy $alldirs = $inst->directories(\"DBI\");\nmy $dirsbelowusrlocal = $inst->directorytree(\"DBI\", \"prog\");\nmy $packlist = $inst->packlist(\"DBI\");\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "ExtUtils::Installed provides a standard way to find out what core and module files have been\ninstalled. It uses the information stored in .packlist files created during installation to\nprovide this information. In addition it provides facilities to classify the installed files and\nto extract directory information from the .packlist files.\n",
            "subsections": []
        },
        "USAGE": {
            "content": "The new() function searches for all the installed .packlists on the system, and stores their\ncontents. The .packlists can be queried with the functions described below. Where it searches by\ndefault is determined by the settings found in %Config::Config, and what the value is of the\nPERL5LIB environment variable.\n",
            "subsections": []
        },
        "METHODS": {
            "content": "Unless specified otherwise all method can be called as class methods, or as object methods. If\ncalled as class methods then the \"default\" object will be used, and if necessary created using\nthe current processes %Config and @INC. See the 'default' option to new() for details.\n",
            "subsections": [
                {
                    "name": "new",
                    "content": "This takes optional named parameters. Without parameters, this searches for all the\ninstalled .packlists on the system using information from %Config::Config and the default\nmodule search paths @INC. The packlists are read using the ExtUtils::Packlist module.\n\nIf the named parameter \"skipcwd\" is true, the current directory \".\" will be stripped from\n@INC before searching for .packlists. This keeps ExtUtils::Installed from finding modules\ninstalled in other perls that happen to be located below the current directory.\n\nIf the named parameter \"configoverride\" is specified, it should be a reference to a hash\nwhich contains all information usually found in %Config::Config. For example, you can obtain\nthe configuration information for a separate perl installation and pass that in.\n\nmy $yodacfg  = getfakeconfig('yoda');\nmy $yodainst =\nExtUtils::Installed->new(configoverride=>$yodacfg);\n\nSimilarly, the parameter \"incoverride\" may be a reference to an array which is used in\nplace of the default module search paths from @INC.\n\nuse Config;\nmy @dirs = split(/\\Q$Config{pathsep}\\E/, $ENV{PERL5LIB});\nmy $p5libs = ExtUtils::Installed->new(incoverride=>\\@dirs);\n\nNote: You probably do not want to use these options alone, almost always you will want to\nset both together.\n\nThe parameter \"extralibs\" can be used to specify additional paths to search for installed\nmodules. For instance\n\nmy $installed =\nExtUtils::Installed->new(extralibs=>[\"/my/lib/path\"]);\n\nThis should only be necessary if /my/lib/path is not in PERL5LIB.\n\nFinally there is the 'default', and the related 'defaultget' and 'defaultset' options.\nThese options control the \"default\" object which is provided by the class interface to the\nmethods. Setting \"defaultget\" to true tells the constructor to return the default object if\nit is defined. Setting \"defaultset\" to true tells the constructor to make the default\nobject the constructed object. Setting the \"default\" option is like setting both to true.\nThis is used primarily internally and probably isn't interesting to any real user.\n"
                },
                {
                    "name": "modules",
                    "content": "This returns a list of the names of all the installed modules. The perl 'core' is given the\nspecial name 'Perl'.\n"
                },
                {
                    "name": "files",
                    "content": "This takes one mandatory parameter, the name of a module. It returns a list of all the\nfilenames from the package. To obtain a list of core perl files, use the module name 'Perl'.\nAdditional parameters are allowed. The first is one of the strings \"prog\", \"doc\" or \"all\",\nto select either just program files, just manual files or all files. The remaining\nparameters are a list of directories. The filenames returned will be restricted to those\nunder the specified directories.\n"
                },
                {
                    "name": "directories",
                    "content": "This takes one mandatory parameter, the name of a module. It returns a list of all the\ndirectories from the package. Additional parameters are allowed. The first is one of the\nstrings \"prog\", \"doc\" or \"all\", to select either just program directories, just manual\ndirectories or all directories. The remaining parameters are a list of directories. The\ndirectories returned will be restricted to those under the specified directories. This\nmethod returns only the leaf directories that contain files from the specified module.\n"
                },
                {
                    "name": "directory_tree",
                    "content": "This is identical in operation to directories(), except that it includes all the\nintermediate directories back up to the specified directories.\n"
                },
                {
                    "name": "validate",
                    "content": "This takes one mandatory parameter, the name of a module. It checks that all the files\nlisted in the modules .packlist actually exist, and returns a list of any missing files. If\nan optional second argument which evaluates to true is given any missing files will be\nremoved from the .packlist\n"
                },
                {
                    "name": "packlist",
                    "content": "This returns the ExtUtils::Packlist object for the specified module.\n"
                },
                {
                    "name": "version",
                    "content": "This returns the version number for the specified module.\n"
                }
            ]
        },
        "EXAMPLE": {
            "content": "See the example in ExtUtils::Packlist.\n",
            "subsections": []
        },
        "AUTHOR": {
            "content": "Alan Burlison <Alan.Burlison@uk.sun.com>\n",
            "subsections": []
        }
    },
    "summary": "ExtUtils::Installed - Inventory management of installed modules",
    "flags": [],
    "examples": [
        "See the example in ExtUtils::Packlist."
    ],
    "see_also": []
}