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.16" - "5.14"
A more extensive example:
language: perl perl: - "5.16" - "5.14" - "5.12" - "5.10" - "5.8"
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 full up-to-date list of provided Perl versions, see our CI environment guide.
Perl versions earlier than 5.8 are not and will not be provided. Please do not list them in
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: