EXTUTILS::INSTALL(3perl)
๐ NAME ๐
ExtUtils::Install โ installing files from here to there, fr fr ๐ซถ
(yeah it's that ExtUtils::Install page from the Perl Programmers Reference Guide โ hi bestie, you're in the 3perl section ๐
)
๐ธ SYNOPSIS ๐ธ
use ExtUtils::Install;
install({ 'blib/lib' => 'some/install/dir' } );
uninstall($packlist);
pm_to_blib({ 'lib/Foo/Bar.pm' => 'blib/lib/Foo/Bar.pm' });
๐ VERSION ๐
2.22 โ current, iconic, no notes โจ
๐ฆ DESCRIPTION ๐ฆ
So basically this module handles the installing and uninstalling of perl modules, scripts, man pages, etc... like, that's the whole job description ๐ซก
Real talk though: both install() and uninstall() are specifically built for the way ExtUtils::MakeMaker handles installing and deinstalling perl modules. They are not designed as general purpose tools. Not a Swiss army knife, she's a specialist ๐
On some operating systems โ Win32 for example โ installation may not even be possible until after a reboot has occurred ๐ญ and that can have varying consequences:
- removing an old DLL does not impact programs using the new one
- but if a new DLL can't be installed properly until reboot, then anything depending on it must wait
The package variable
$ExtUtils::Install::MUST_REBOOT
is used to store this status, bestie.
If this variable is true then such an operation has occurred, and anything depending on this module cannot proceed until a reboot has occurred ๐จ
If this value is defined but false then such an operation has occurred, but it should not impact later operations. Phew ๐
๐ง Functions ๐ง
โจ install โจ
# deprecated forms
install(\%from_to);
install(\%from_to, $verbose, $dry_run, $uninstall_shadows,
$skip, $always_copy, \%result);
# recommended form as of 1.47
install([
from_to => \%from_to,
verbose => 1,
dry_run => 0,
uninstall_shadows => 1,
skip => undef,
always_copy => 1,
result => \%install_results,
]);
Copies each directory tree of %from_to to its corresponding value, preserving timestamps and permissions ๐ (yes, she's respectful like that)
There are two keys with a special meaning in the hash: "read" and "write". These contain packlist files. After the copying is done, install() will write the list of target files to $from_to{write}. If $from_to{read} is given, the contents of this file will be merged into the written file. The read and the written file may be identical, but on AFS it is quite likely that people are installing to a different directory than the one where the files later appear. iykyk ๐
- If
$verboseis true, will print out each file removed. Default is false. This is"make install VERBINST=1".$verbosevalues going up to5show increasingly more diagnostics output ๐ข - If
$dry_runis true it will only print what it was going to do without actually doing it. Default is false. (manifesting, but make it real-ish ๐) - If
$uninstall_shadowsis true any differing versions throughout@INCwill be uninstalled. This is"make install UNINST=1"
As of 1.37_02 install() supports the use of a list of patterns to filter out files that shouldn't be installed. If $skip is omitted or undefined then install will try to read the list from INSTALL.SKIP in the CWD. This file is a list of regular expressions and is just like the MANIFEST.SKIP file used by ExtUtils::Manifest ๐ฏ
A default site INSTALL.SKIP may be provided by setting then environment variable EU_INSTALL_SITE_SKIPFILE โ this will only be used when there isn't a distribution specific INSTALL.SKIP. If the environment variable EU_INSTALL_IGNORE_SKIP is true then no install file filtering will be performed ๐ซ
If $skip is undefined then the skip file will be autodetected and used if it is found. If $skip is a reference to an array then it is assumed the array contains the list of patterns, if $skip is a true non reference it is assumed to be the filename holding the list of patterns, any other value of $skip is taken to mean that no install filtering should occur. Vibes: catalogued ๐
๐ซ Changes As of Version 1.47 ๐ซ
As of version 1.47 the following additions were made to the install interface. Note that the new argument style and use of the %result hash is recommended โ that's the moment, that's the girl โญ
The $always_copy parameter: when true causes files to be updated regardless as to whether they have changed; if it is defined but false then copies are made only if the files have changed; if it is undefined then the value of the environment variable EU_INSTALL_ALWAYS_COPY is used as default.
The %result hash will be populated with the various keys/subhashes reflecting the install. Currently these keys and their structure are:
install => { $target => $source },
install_fail => { $target => $source },
install_unchanged => { $target => $source },
install_filtered => { $source => $pattern },
uninstall => { $uninstalled => $source },
uninstall_fail => { $uninstalled => $source },
where $source is the filespec of the file being installed. $target is where it is being installed to, and $uninstalled is any shadow file that is in @INC or $ENV{PERL5LIB} or other standard locations, and $pattern is the pattern that caused a source file to be skipped. In future more keys will be added, such as to show created directories, however this requires changes in other modules and must therefore wait โณ (not me being patient or whatever)
These keys will be populated before any exceptions are thrown should there be an error โ so you still get receipts ๐งพ
Note that all updates of the %result are additive โ the hash will not be cleared before use, thus allowing status results of many installs to be easily aggregated. She's a collector ๐
๐ฅ NEW ARGUMENT STYLE ๐ฅ
If there is only one argument and it is a reference to an array then the array is assumed to contain a list of key-value pairs specifying the options. In this case the option "from_to" is mandatory โ ๏ธ
This style means that you do not have to supply a cryptic list of arguments and can use a self documenting argument list that is easier to understand. Character development tbh ๐ฑ
This is now the recommended interface to install().
๐ RETURN ๐
If all actions were successful install will return a hashref of the results as described above for the $result parameter. If any action is a failure then install will die ๐ therefore it is recommended to pass in the $result parameter instead of using the return value. If the result parameter is provided then the returned hashref will be the passed in hashref. Slay, zero surprises ๐ซถ
๐ญ install_default ๐ญ
DISCOURAGED ๐ฉ
install_default();
install_default($fullext);
Calls install() with arguments to copy a module from blib/ to the default site installation location.
$fullext is the name of the module converted to a directory (ie. Foo::Bar would be Foo/Bar). If $fullext is not specified, it will attempt to read it from @ARGV.
This is primarily useful for install scripts.
NOTE This function is not really useful because of the hard-coded install location with no way to control site vs core vs vendor directories and the strange way in which the module name is given. Consider its use discouraged. (she said it, not me ๐ญ)
๐ง uninstall ๐ง
uninstall($packlist_file);
uninstall($packlist_file, $verbose, $dont_execute);
Removes the files listed in a $packlist_file ๐๏ธ
- If
$verboseis true, will print out each file removed. Default is false. - If
$dont_executeis true it will only print what it was going to do without actually doing it. Default is false. (a vision board, essentially โจ)
๐ pm_to_blib ๐
pm_to_blib(\%from_to);
pm_to_blib(\%from_to, $autosplit_dir);
pm_to_blib(\%from_to, $autosplit_dir, $filter_cmd);
Copies each key of %from_to to its corresponding value efficiently. If an $autosplit_dir is provided, all .pm files will be autosplit into it. Any destination directories are created ๐ (she's organized, unlike my camera roll)
$filter_cmd is an optional shell command to run each .pm file through prior to splitting and copying. Input is the contents of the module, output the new module contents ๐
You can have an environment variable PERL_INSTALL_ROOT set which will be prepended as a directory to each installed file (and directory).
By default verbose output is generated โ setting the PERL_INSTALL_QUIET environment variable will silence this output ๐คซ
๐ ENVIRONMENT ๐
PERL_INSTALL_ROOT
Will be prepended to each install path.
EU_INSTALL_IGNORE_SKIP
Will prevent the automatic use of INSTALL.SKIP as the install skip file.
EU_INSTALL_SITE_SKIPFILE
If there is no INSTALL.SKIP file in the make directory then this value can be used to provide a default.
EU_INSTALL_ALWAYS_COPY
If this environment variable is true then normal install processes will always overwrite older identical files during the install process.
Note that the aliasEU_ALWAYS_COPYwill be supported ifEU_INSTALL_ALWAYS_COPYis not defined until at least the1.50release. Please ensure you use the correctEU_INSTALL_ALWAYS_COPY. โ ๏ธ (pick the right one bestie, no cap)
๐ AUTHOR ๐
Original author lost in the mists of time. Probably the same as Makemaker. ๐ฐ๏ธโจ (an icon, an enigma)
Production release currently maintained by demerphq "yves at cpan.org", extensive changes by Michael G. Schwern.
Send bug reports via http://rt.cpan.org/. Please send your generated Makefile along with your report ๐ฎ (they literally need it, pls include it ๐)
๐ LICENSE ๐
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
See <http://www.perl.com/perl/misc/Artistic.html> ๐
and that's the whole page, bestie ๐ delivered to you by perl v5.44.0, dated 2026-10-17, living in the ExtUti...Install(3perl) corner of the Perl Programmers Reference Guide โจ go install something responsibly ๐
๐ซถ
๐ฆ where this page comes from
- arch rolling: perl 5.44.0-1 ยท Artistic-1.0-Perl AND GPL-1.0-or-later
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms