Building a Perl Project
What This Guide Covers
Choosing Perl versions to test against
Perl workers on travis-ci.org use Perlbrew to provide several Perl versions your projects can be tested against. To specify them, use
perl: key in your
.travis.yml file, for example:
language: perl perl: - "5.20" - "5.18"
A more extensive example:
language: perl perl: - "5.20" - "5.18" - "5.16" - "5.14"
As time goes, new releases come out and we upgrade both Perlbrew and Perls, aliases like
5.14 will float and point to different exact versions, patch levels and so on.
For precise versions pre-installed on the VM, please consulte "Build system information" in the build log.
Perl versions earlier than 5.8 are not and will not be provided. Please do not list them in
Perl runtimes with
Additionally, Perl 5.18 and 5.20 with
-Duseshrplib are available as
Default Perl Version
If you leave the
perl key out of your
.travis.yml, Travis CI will use Perl 5.14.
Default Test Script
If your repository has Build.PL in the root, it will be used to generate the build script:
perl Build.PL && ./Build test
If your repository has Makefile.PL in the root, it will be used like so
perl Makefile.PL && make test
If neither Module::Build nor EUMM build files are found, Travis CI will fall back to running
It is possible to override test command as described in the general build configuration guide.
Travis CI uses cpanm
By default Travis CI use
cpanm to manage your project's dependencies. It is possible to override dependency installation command as described in the general build configuration guide.
The exact default command is
cpanm --quiet --installdeps --notest .
When Overriding Build Commands, Do Not Use sudo
install: key to tweak dependency installation command (for example, to run cpanm with verbosity flags), do not use sudo.
Travis CI Environment has Perls installed via Perlbrew in non-privileged user $HOME directory. Using sudo will result in dependencies
being installed in unexpected (for Travis CI Perl builder) locations and they won't load.
For Perl projects,
perl can be given as arrays
to construct a build matrix.
The version of Perl a job is using is available as: