The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

App::MechaCPAN::Perl - Mechanize the installation of Perl.

SYNOPSIS

  # Install 5.24 into local/
  user@host:~$ mechacpan perl 5.24

DESCRIPTION

The perl command is used to install perl into local/. This removes the package's dependency on the operating system perl. It will do this by either downloading a binary archive or by building from a perl source archive.

Methods

go( \%opts, $version )

There is only a single public function that should be called. This will install the version of perl given in $version using the options in \%opts. The options available are listed in the arguments section below.

$version is either 0 or 1 parameter:

  • If 0 parameters are given and there is a .perl-version file, it will try and use that as the version to install.

  • Otherwise, if 0 parameters are given, it will attempt to find and install the newest, stable version of perl.

  • If the parameter is a file, it will try to use that file as an archive to install perl.

  • If the parameter looks like a URL, it will fetch that URL and try to use it as an archive to install perl.

  • If the parameter is a major version (5.XX), it will attempt to download and install the newest minor version of that major version.

  • If the parameter is a minor version (5.XX.X), it will attempt to download and install that exact version.

In the cases where a version is given, and the --no-source-only option is given, App::MechaCPAN::Perl will attempt to download a binary archive prebuilt for the operating system. This guess is made by looking at how the currently executing perl was built. Binary archives are fetched from https://dnld.mechacpan.us/dist. Source archives are fetched from https://www.cpan.org/src/5.0.

After an archive is retrieved, it will be checked to see if it is a binary or source package. This is accomplished by checking for an executable bin/perl file in the archive. Basic tests are ran to make sure the binary is usable, notably by running a script that includes POSIX.

Arguments

source-only

By default a source archive is attempted to be retreived and installed. If you want it to attempt to also retrieve a binary archive, you can use --no-source-only. If you do not want App::MechaCPAN::Perl to even attempt to use a binary archive, use this option. The default behavior of this option will change in a future version.

threads

By default, perl is compiled without threads. If you'd like to enable threads, use this argument.

shared-lib

By default, perl will not generate a libperl.a file. If you need libperl.so, then use this argument.

jobs

How many make jobs to use when running make. The code will guess if make supports running multiple jobs, and as such, it may not work for all versions of make. Defaults to 2.

skip-tests

Test for perl are ran by default. If you are sure that the tests will pass and you want to save some time, you can skip the testing phase with this option.

smart-tests

As an alternative to telling App::MechaCPAN::Perl to use tests or not, App::MechaCPAN::Perl can try to be clever and guess if it needs to run tests. If there is a .perl-version file and it is the same version that is being installed, then tests will be skips. The thinking is that if there is a .perl-version file, then it is likely that perl has been installed and tested before.

smart-tests are off by default, but are enabled by App::MechaCPAN::Deploy when there is a cpanfile.snapshot file. See "smart-tests" in App::MechaCPAN::Install.

skip-local

Since perl and modules will be installed by App::MechaCPAN into local/, by default local/ will be added to @INC. This means that if you use the local/ installed perl you do not need to use local::lib or other @INC tricks. If you want to suppress this behavior, use this flag.

skip-lib

If a lib/ directory exists in the same directory as the local/ directory, then lib/ will also bee added to @INC. This is helpful if you're installing to run an application that includes a lib/ directory. If you do not want this to be added, use this flag.

devel

By default, perl will not compile a development version without -Dusedevel passed to configure. This adds that flag to the configure step so that perl will install unstable development versions. This is NOT recommended except for testing.

WIN32 LIMITATION

Building perl from scratch on Win32 is nothing like building it on other platforms. At this point, the perl command does not work on Win32.

AUTHOR

Jon Gentle <cpan@atrodo.org>

COPYRIGHT

Copyright 2017- Jon Gentle

LICENSE

This is free software. You may redistribute copies of it under the terms of the Artistic License 2 as published by The Perl Foundation.

SEE ALSO

plenv
App::perlbrew