CPAN::FirstTime(3pm)
πΈ NAME πΈ
CPAN::FirstTime - Utility for CPAN::Config file Initialization
(it's the little setup wizard for your CPAN config, and yes it's a whole vibe π )
β¨ SYNOPSIS β¨
CPAN::FirstTime::init()
π¦ DESCRIPTION π¦
The init routine asks a few questions and writes a CPAN/Config.pm or CPAN/MyConfig.pm file (depending on what it is currently using).
In the following all questions and explanations regarding config variables are collected.
Basically: it interviews you, then it writes the file. No cap, that's the whole plot π
π allow_installing_module_downgrades
Okay so the CPAN shell can watch the blib/ directories that are built up before running make test to determine whether the current distribution will end up with modules being overwritten with decreasing module version numbers. It can then let the build of this distro fail when it discovers a downgrade.
π¬ Do you want to allow installing distros with decreasing module versions compared to what you have installed (yes, no, ask/yes, ask/no)?
π allow_installing_outdated_dists
The CPAN shell can watch the blib/ directories that are built up before running make test to determine whether the current distribution contains modules that are indexed with a distro with a higher distro-version number than the current one. It can then let the build of this distro fail when it would not represent the most up-to-date version of the distro.
β οΈ Note: choosing anything but 'yes' for this option will need CPAN::DistnameInfo being installed for taking effect.
π¬ Do you want to allow installing distros that are not indexed as the highest distro-version for all contained modules (yes, no, ask/yes, ask/no)?
π auto_commit
Normally CPAN.pm keeps config variables in memory and changes need to be saved in a separate o conf commit command to make them permanent between sessions. If you set the auto_commit option to true, changes to a config variable are always automatically committed to disk.
π¬ Always commit changes to config variables to disk?
π build_cache
CPAN.pm can limit the size of the disk area for keeping the build directories with all the intermediate files.
π¬ Cache size for build directory (in MB)?
π build_dir
Directory where the build process takes place?
π build_dir_reuse
Until version 1.88 CPAN.pm never trusted the contents of the build_dir directory between sessions. Since 1.88_58 CPAN.pm has a YAML-based mechanism that makes it possible to share the contents of the build_dir/ directory between different sessions with the same version of perl. People who prefer to test things several days before installing will like this feature because it saves a lot of time.
If you say yes to the following question, CPAN will try to store enough information about the build process so that it can pick up in future sessions at the same state of affairs as it left a previous session.
π¬ Store and re-use state information about distributions between CPAN.pm sessions?
π build_requires_install_policy
When a module declares another one as a build_requires prerequisite this means that the other module is only needed for building or testing the module but need not be installed permanently. In this case you may wish to install that other module nonetheless or just keep it in the build_dir directory to have it available only temporarily. Installing saves time on future installations but makes the perl installation bigger.
You can choose if you want to always install (yes), never install (no) or be always asked. In the latter case you can set the default answer for the question to yes (ask/yes) or no (ask/no).
π¬ Policy on installing build_requires modules (yes, no, ask/yes, ask/no)?
π cache_metadata
To considerably speed up the initial CPAN shell startup, it is possible to use Storable to create a cache of metadata. If Storable is not available, the normal index mechanism will be used.
β οΈ Note: this mechanism is not used when use_sqlite is on and SQLite is running.
π¬ Cache metadata (yes/no)?
π check_sigs
CPAN packages can be digitally signed by authors and thus verified with the security provided by strong cryptography. The exact mechanism is defined in the Module::Signature module. While this is generally considered a good thing, it is not always convenient to the end user to install modules that are signed incorrectly or where the key of the author is not available or where some prerequisite for Module::Signature has a bug and so on.
With the check_sigs parameter you can turn signature checking on and off. The default is off for now because the whole tool chain for the functionality is not yet considered mature by some. The author of CPAN.pm would recommend setting it to true most of the time and turning it off only if it turns out to be annoying.
β οΈ Note that if you do not have Module::Signature installed, no signature checks will be performed at all.
π¬ Always try to check and verify signatures if a SIGNATURE file is in the package and Module::Signature is installed (yes/no)?
π cleanup_after_install
Users who install modules and do not intend to look back, can free occupied disk space quickly by letting CPAN.pm cleanup each build directory immediately after a successful install.
π¬ Remove build directory after a successful install? (yes/no)?
π colorize_output
When you have Term::ANSIColor installed, you can turn on colorized output to have some visual differences between normal CPAN.pm output, warnings, debugging output, and the output of the modules being installed. Set your favorite colors after some experimenting with the Term::ANSIColor module.
β οΈ Please note that on Windows platforms colorized output also requires the Win32::Console::ANSI module.
π¬ Do you want to turn on colored output?
π colorize_print
Color for normal output?
π colorize_warn
Color for warnings?
π colorize_debug
Color for debugging messages?
π commandnumber_in_prompt
The prompt of the cpan shell can contain the current command number for easier tracking of the session or be a plain string.
π¬ Do you want the command number in the prompt (yes/no)?
π connect_to_internet_ok
If you have never defined your own urllist in your configuration then CPAN.pm will be hesitant to use the built in default sites for downloading. It will ask you once per session if a connection to the internet is OK and only if you say yes, it will try to connect. But to avoid this question, you can choose your favorite download sites once and get away with it. Or, if you have no favorite download sites answer yes to the following question.
π¬ If no urllist has been chosen yet, would you prefer CPAN.pm to connect to the built-in default sites without asking? (yes/no)?
π ftp_passive
Shall we always set the FTP_PASSIVE environment variable when dealing with ftp download (yes/no)?
π ftpstats_period
Statistics about downloads are truncated by size and period simultaneously.
π¬ How many days shall we keep statistics about downloads?
π ftpstats_size
Statistics about downloads are truncated by size and period simultaneously. Setting this to zero or negative disables download statistics.
π¬ How many items shall we keep in the statistics about downloads?
π getcwd
CPAN.pm changes the current working directory often and needs to determine its own current working directory. Per default it uses Cwd::cwd but if this doesn't work on your system for some reason, alternatives can be configured according to the following table:
cwd Cwd::cwd
getcwd Cwd::getcwd
fastcwd Cwd::fastcwd
getdcwd Cwd::getdcwd
backtickcwd external command cwd
π¬ Preferred method for determining the current working directory?
π halt_on_failure
Normally, CPAN.pm continues processing the full list of targets and dependencies, even if one of them fails. However, you can specify that CPAN should halt after the first failure. (Note that optional recommended or suggested modules that fail will not cause a halt.)
π¬ Do you want to halt on failure (yes/no)?
π histfile
If you have one of the readline packages (Term::ReadLine::Perl, Term::ReadLine::Gnu, possibly others) installed, the interactive CPAN shell will have history support. The next two questions deal with the filename of the history file and with its size. If you do not want to set this variable, please hit SPACE ENTER to the following question.
π¬ File to save your history?
π histsize
π¬ Number of lines to save?
π inactivity_timeout
Sometimes you may wish to leave the processes run by CPAN alone without caring about them. Because the Makefile.PL or the Build.PL sometimes contains question you're expected to answer, you can set a timer that will kill a perl Makefile.PL process after the specified time in seconds.
β οΈ If you set this value to 0, these processes will wait forever. This is the default and recommended setting.
π¬ Timeout for inactivity during {Makefile,Build}.PL?
π index_expire
The CPAN indexes are usually rebuilt once or twice per hour, but the typical CPAN mirror mirrors only once or twice per day. Depending on the quality of your mirror and your desire to be on the bleeding edge, you may want to set the following value to more or less than one day (which is the default). It determines after how many days CPAN.pm downloads new indexes.
π¬ Let the index expire after how many days?
π inhibit_startup_message
When the CPAN shell is started it normally displays a greeting message that contains the running version and the status of readline support.
π¬ Do you want to turn this message off?
π keep_source_where
Unless you are accessing the CPAN on your filesystem via a file: URL, CPAN.pm needs to keep the source files it downloads somewhere. Please supply a directory where the downloaded files are to be kept.
π¬ Download target directory?
π load_module_verbosity
When CPAN.pm loads a module it needs for some optional feature, it usually reports about module name and version. Choose v to get this message, none to suppress it.
π¬ Verbosity level for loading modules (none or v)?
π makepl_arg
Every Makefile.PL is run by perl in a separate process. Likewise we run make and make install in separate processes. If you have any parameters (e.g. PREFIX, UNINST or the like) you want to pass to the calls, please specify them here.
If you don't understand this question, just press ENTER.
Typical frequently used settings:
PREFIX=~/perl # non-root users (please see manual for more hints)
Parameters for the perl Makefile.PL command?
make_arg
Okay so this is where you tell make how to behave β the literal args that get handed over when make runs. The classic, the one everybody uses:
-j3 # dual processor system (on GNU make)
That's it, that's the vibe. Parallel builds, we love to see it. β¨
Prompt: Your choice:
make_install_arg
Same deal, but these args go to make install specifically:
UNINST=1 # to always uninstall potentially conflicting files
# (but do NOT use with local::lib or INSTALL_BASE)
π¨ Read that comment again bestie. ThatUNINST=1is a hard NO if you're runninglocal::liborINSTALL_BASE. Like, do not. It will eat your files and not feel bad about it. π
Prompt: Your choice:
make_install_make_command
Do you wanna run make install with a different command than plain old make? The cautious girlies (respectfully, they're right) usually go with one of these:
su root -c make
or
sudo make
or
/path1/to/sudo -u admin_account /path2/to/make
...or some such. You get the idea, it's giving "elevate me to do the install part". π
Prompt: Your choice:
mbuildpl_arg
Real talk: a Build.PL gets run by perl in a separate process. And likewise, ./Build and ./Build install each get their own separate processes too. So if you've got any parameters you want to pass to those calls? Please, for the love of everything, put them here. π«Ά
Typical frequently used settings:
--install_base /home/xxx # different installation directory
Prompt: Parameters for the perl Build.PL command?
mbuild_arg
Args for running ./Build. A setting might be:
--extra_linker_flags -L/usr/foo/lib # non-standard library location
Prompt: Your choice:
mbuild_install_arg
Args for ./Build install. Typical frequently used setting:
--uninst 1 # uninstall conflicting files
# (but do NOT use with local::lib or INSTALL_BASE)
π Same warning as theUNINST=1one above β do NOT use this withlocal::liborINSTALL_BASE. We're being so serious rn.
Prompt: Your choice:
mbuild_install_build_command
Wanna run ./Build install with a different command? The sudo girlies will probably prefer:
su root -c ./Build
or
sudo ./Build
or
/path1/to/sudo -u admin_account ./Build
...or some such. Prompt: Your choice:
pager
What's your favorite pager program? π (Yes this is a genuine question, answer it.)
prefer_installer
Okay this one needs context. So when you have Module::Build installed AND a module ships with both a Makefile.PL and a Build.PL... which one gets to be the main character? π
The two big standard installer modules are:
- the old and well established ExtUtils::MakeMaker (for short: EUMM) β this one uses the
Makefile.PL. - the next generation installer Module::Build (MB) β this one works with the
Build.PL(and it often comes with aMakefile.PLtoo, fyi).
If a module comes with only one of the two, we just use that one, no drama. But if both are supplied, a decision has to be made between EUMM and MB. There's a whole discussion about what the right default even is, over at http://rt.cpan.org/Ticket/Display.html?id=29235 if you want the lore. π
Or β third option, and this is iconic β you can pick RAND, which makes a random decision. (The regular CPAN testers will genuinely enjoy this one. Chaos gremlin energy, but make it by design. π²)
Prompt: In case you can choose between running a Makefile.PL or a Build.PL, which installer would you prefer (EUMM or MB or RAND)?
prefs_dir
So CPAN.pm can store customized build environments, keyed on regular expressions for distribution names. These are YAML files where the default options for CPAN.pm and the environment can be overridden, and dialog sequences can be stored that can later be executed by an Expect.pm object. Very "automation slay". π€β¨
The CPAN.pm distribution actually ships with some prefab YAML files that cover sample distributions β use them as blueprints to store your own prefs. Peep the distroprefs/ directory of the CPAN.pm distribution to get a quick start into the prefs system. ποΈ
Prompt: Directory where to store default options/environment/dialogs for building modules that need some customization?
prerequisites_policy
This is the "what do I do about dependencies" question. The CPAN module can detect when a module you're trying to build depends on prerequisites, and then it's got three moods:
followβ build the prerequisites for you automatically. Set it and forget it. πaskβ check in with you for confirmation first. Respectful.ignoreβ just ignore them. Live your truth, but like... know what you're doing.
Heads up: choosing follow also sets PERL_AUTOINSTALL and PERL_EXTUTILS_AUTOINSTALL for --defaultdeps if they're not already set. β οΈ
Prompt: Please set your policy to one of the three values. Policy on building prerequisites (follow, ask or ignore)?
pushy_https
Boolean. Defaults to true. π
If it's true, the cpan shell will use https://cpan.org/ to download stuff from the CPAN. If it can't handle https for some reason (missing modules, missing programs), it'll fall back to http://cpan.org/ β and whenever it falls back to the http protocol, it will issue a warning. Fair enough, honestly. π¨
But here's the catch bestie: if this option is true, the urllist option gets ignored. So if you want to work with local mirrors via your own configured list of URLs? You'll have to choose no below.
Prompt: Do you want to turn the pushy_https behaviour on?
randomize_urllist
CPAN.pm can add some β¨spiceβ¨ when using the download hosts configured in the urllist parameter. Enter a numeric value between 0 and 1 to say how often you want CPAN.pm to try a random host from the urllist:
- a value of
1β always use a random host as the first try - a value of
0β no randomness at all - anything in between β how often, on average, a random host should be tried first
Prompt: Randomize parameter
recommends_policy
(Experimental feature! π§ͺ) Some CPAN modules recommend additional, optional dependencies. These should generally be installed, except in resource constrained environments. When this policy is true, recommended modules will be included with required modules.
Prompt: Include recommended modules?
scan_cache
By default, every time the CPAN module starts up, cache scanning happens to keep the cache size in sync β that's atstart. Alternatively, scanning and cleanup can happen when CPAN exits β that's atexit. And if you want to prevent any cache cleanup at all, answer never. π§Ή
Prompt: Perform cache scanning (atstart, atexit or never)?
shell
What's your favorite shell? (Be honest. π)
show_unparsable_versions
During the r command, CPAN.pm finds modules without version numbers. When the command finishes, it prints a report about this. If you want that report to be very verbose, say yes to this variable. π
Prompt: Show all individual modules that have no $VERSION?
show_upload_date
The d and the m command normally only show you info they have in their in-memory database, so they'll never connect to the internet. But if you set show_upload_date to true, m and d will additionally show you the upload date of the module or distribution. Per default this feature is off, because it may require a net connection to get at the upload date. π
Prompt: Always try to show upload date with d and m command (yes/no)?
show_zero_versions
During the r command, CPAN.pm finds modules with a version number of zero. When the command finishes, it prints a report about this. Want that report super verbose? Say yes. 0οΈβ£
Prompt: Show all individual modules that have a $VERSION of zero?
suggests_policy
(Experimental feature! π§ͺ) Some CPAN modules suggest additional, optional dependencies. These suggest dependencies provide enhanced operation. When this policy is true, suggested modules will be included with required modules.
Prompt: Include suggested modules?
tar_verbosity
When CPAN.pm uses the tar command, which switch for verbosity shall be used? Pick your fighter:
noneβ quiet operation π€«vβ file name listingvvβ full listing, maximum yapping
Prompt: Tar command verbosity level (none or v or vv)?
term_is_latin
Okay this next one is about the charset (a.k.a. character set) your terminal supports. In general, CPAN is English speaking territory, so the charset doesn't matter much β BUT some CPAN [authors] have names that are outside the ASCII range. π
- Your terminal supports UTF-8? Say no to the next question.
- It expects ISO-8859-1 (also known as LATIN1)? Say yes.
- It supports neither? Your answer does not matter, because you won't be able to read the names of some authors anyway. π
And if you answer no, names will be output in UTF-8.
Prompt: Your terminal expects ISO-8859-1 (yes/no)?
term_ornaments
When using Term::ReadLine, you can turn ornaments on so that your input stands out against the output from CPAN.pm. Aesthetic + functional, we stan. π
Prompt: Do you want to turn ornaments on?
test_report
The goal of the CPAN Testers project (http://testers.cpan.org/) is to test as many CPAN packages as possible on as many platforms as possible. This provides valuable feedback to module authors and potential users to identify bugs or platform compatibility issues, and it improves the overall quality and value of CPAN. Genuinely a community W. π«Ά
One way you can contribute is to send test results for each module that you install. If you install the CPAN::Reporter module, you have the option to automatically generate and deliver test reports to CPAN Testers whenever you run tests on a CPAN package.
See the CPAN::Reporter documentation for additional details and configuration settings. Also, if your firewall blocks outgoing traffic, you may need to configure CPAN::Reporter before sending reports. π₯
Prompt: Generate test reports if CPAN::Reporter is installed (yes/no)?
perl5lib_verbosity
When CPAN.pm extends @INC via PERL5LIB, it prints a list of directories added (or a summary of how many directories are added). Choose v to get this message, none to suppress it.
Prompt: Verbosity level for PERL5LIB changes (none or v)?
prefer_external_tar
Per default, all untar operations are done with the perl module Archive::Tar. But if you set this variable to true, the external tar command is used if available. On Unix this is usually preferred, because they have a reliable and fast gnutar implementation. β‘
Prompt: Use the external tar program instead of Archive::Tar?
trust_test_report_history
When a distribution has already been tested by CPAN::Reporter on this machine, CPAN can skip the test phase and just rely on the test report history instead. Efficiency queen. β©
π Note: this will not apply to distributions that failed tests because of missing dependencies. And also, tests can be run regardless of the history using force.
Prompt: Do you want to rely on the test report history (yes/no)?
urllist_ping_external
When automatic selection of the nearest cpan mirrors is performed, this turns on the use of the external ping via Net::Ping::External. Recommended in the case the local network has a transparent proxy. π°οΈ
Prompt: Do you want to use the external ping command when autoselecting mirrors?
urllist_ping_verbose
Also during automatic selection of the nearest cpan mirrors β this option turns on verbosity during the selection process. Basically: do you want to watch it happen or not. π
Prompt: Do you want to see verbosity turned on when autoselecting mirrors?
use_prompt_default π
okay so when this one's set to true, CPAN goes ahead and sets PERL_MM_USE_DEFAULT to a true value. what that means bestie is that ExtUtils::MakeMaker (and anything compatible with it) will just quietly take the default values instead of stopping mid-install to interrogate you about stuff. it also sets NONINTERACTIVE_TESTING to a true value, which is basically a lil signal to the wider world that distributions should not try to interact with you, periodt.
the prompt it hits you with: Do you want to use prompt defaults (yes/no)?
use_sqlite π¦
so CPAN::SQLite is this whole layer that sits between the index files (the ones downloaded from the CPAN) and CPAN.pm, and it speeds up metadata queries and cuts down CPAN.pm's memory consumption considerably. it's giving glow-up for your index lookups, no cap.
the prompt: Use CPAN::SQLite if available? (yes/no)?
version_timeout β±οΈ
this timeout exists so CPAN doesn't just hang forever trying to parse a pathologically coded $VERSION out of some module. dramatic? no, necessary.
the default is 15 seconds. if you set this value to 0, no timeout will occur β but heads up, that is not recommended. like, pls don't.
the prompt: Timeout for parsing module versions?
yaml_load_code π
both YAML.pm and YAML::Syck can deserialise code. sounds cute until you remember that requires a string eval, which might be a security risk π so this option is your little switch to enable or disable the deserialisation of code via CPAN::DeferredCode.
small but important note: this does not work under perl 5.6.
the prompt: Do you want to enable code deserialisation (yes/no)?
yaml_module πΈ
at the time of this writing (2009-03) there are three YAML implementations that actually work: YAML, YAML::Syck, and YAML::XS. the latter two are faster, but they need a C compiler installed on your system β so factor that in, bestie. there may be more alternative YAML conforming modules out there too. when the author tried two other players, YAML::Tiny and YAML::Perl, they seemed not powerful enough to work with CPAN.pm β but that may have changed in the meantime, iykyk.
the prompt: Which YAML implementation would you prefer?
π LICENSE π
this program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. literally that's it, that's the whole vibe. π«Ά
and that's a wrap on the whole page, bestie β¨ this was perl v5.42.3, dated 2026-11-03 β go forth and configure your CPAN with main character energy π
π
π¦ where this page comes from
- alpine 3.24: perl-doc 5.42.3-r0 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms