Install and configure perlbrew, perl, and CPAN modules

Chadwick Banning



9,869 latest version

4.4 quality score

Version information

  • 0.2.2 (latest)
  • 0.2.1
  • 0.2.0
  • 0.1.1
  • 0.1.0
released Sep 22nd 2014
This version is compatible with:
  • RedHat

Start using this module


walkamongus/perlbrew — version 0.2.2 Sep 22nd 2014

perlbrew Puppet Module

Build Status

Table of Contents

  1. Overview
  2. Module Description
  3. Setup - The basics of getting started with perlbrew
  4. Usage - Configuration options and additional functionality
  5. Reference - An under-the-hood peek at what the module is doing and how
  6. Limitations - OS compatibility, etc.


This module installs and configures Perlbrew. It also includes optional classes to install Perl and CPAN modules via Perlbew.

Module Description

This module primarily focuses on installing and configuring Perlbrew. There are optional classes that may be declared for installing a spcific version of Perl as well as installing CPAN modules for a Perl installed with Perlbrew.

Perlbrew configuration is currently limited. Perl compile-time options may be passed to the perlbrew::perl class.

Using the perlbrew:perl class will automatically install the Bundle::LWP and Crypt::SSLeay modules if they are not present on the system. This enables the installation of CPAN modules from HTTPS mirrors.

CPAN module installation is done via a dynamically generated cpanfile.


What perlbrew affects

  • Packages
    • curl
  • Files
    • perlbrew root directory
    • cpanfile
  • Execs
    • perlbrew installation
    • perl installation
    • switch to perl version
    • cpan installation
    • Bundle::LWP and Crypt::SSLeay installation
    • additional cpan module installation

Beginning with perlbrew

Install and configure Perlbrew with defaults:

include ::perlbrew


Install Perlbrew to a custom directory:

class {'::perlbrew':
  perlbrew_root => '/usr/local/perlbrew',

Install default Perl version 5.16.3:

perlbrew::perl {'my_perl_install': }

Install a different customized Perl version using Perlbrew:

perlbrew::perl {'my_perl_install':
  version         => '5.12.3',
  compile_options => [

Install a CPAN module:

perlbrew::cpan::module {'Class::DBI': }

Install a CPAN module with custom install options:

perlbrew::cpan::module {'Class::C3': }
class {'perlbrew::cpan::install':
  options => [




  • perlbrew_root: perlbrew installation root directory. Defaults to '/opt/perl5'
  • perlbrew_init_file: file to hold required perlbrew ENV variables. This file should be sourced by users on login. Defaults to '/etc/profile.d/'


  • version: perl version string to install via perlbrew. Should be recognizeable by perlbrew. Defaults to '5.16.3'
  • compile_options: Array of perlbrew options that get passed to the perlbrew perl installation command. Defaults to empty array


  • cpanfile_dir: Directory in which the cpanfile is placed. Defaults to '/tmp'
  • options: Array of options passed to the cpan command for module installation. The '--installdeps' option is always passed in order to install from the cpanfile.


  • version: Version string or range for the module to install. See Version_Formats for more information.


  • perlbrew::params
  • perlbrew::init
  • perlbrew::install
  • perlbrew::config
  • perlbrew::perl
  • perlbrew::cpan::install
  • perlbrew::cpan::module


Developed using:

  • Puppet 3.6.2
  • CentOS 6.5