Perl
Enables local Perl module installation on macOS and defines aliases.
Local Module Installation
Perl versions older than 5.14 do not support the local installation of Perl modules natively. This module allows for local installation of Perl modules on macOS in ~/Library/Perl/5.12 by altering the environment.
Usage
For Perl versions older than 5.14, install local::lib.
curl -L -C - -O http://search.cpan.org/CPAN/authors/id/A/AP/APEIRON/local-lib-1.008004.tar.gz
tar xvf local-lib-1.008004.tar.gz
cd local-lib-1.008004
perl Makefile.PL --bootstrap=$HOME/Library/Perl/5.12
make && make test && make install
Install cpanminus:
curl -L http://cpanmin.us | perl - --self-upgrade
Perlbrew
An alternative to the above is to use Perlbrew, which allows for the management of multiple, isolated Perl installations in the home directory.
plenv
Yet another alternative is plenv. This is inspired from rbenv and enables switching between multiple binary installations.
The subcommands of plenv is similar with rbenv.
Aliases
General
plis short forperl.pldlooks up Perl documentation (perldoc).pleexecutes a one line program in a loop (perl -wlne).
Perlbrew
plbmanages Perl environments.plbalists available Perl versions.plbiinstalls a Perl version.plbllists installed Perl versions.plbotemporarily turns off Perlbrew.plbOturns off Perlbrew.plbsswitches to a Perl version.plbuuninstalls a Perl version.plbxtemporarily sets the Perl version to use.
plenv
plvmanages Perl environments.plvcList all available plenv commands.plvlSet or show the local application-specific Perl version.plvgSet or show the global Perl version.plvsSet or show the shell-specific Perl version.plviInstall a Perl version using the perl-build plugin.plvuUninstall a specific Perl version.plvrRehash plenv shims (run this after installing executables).plvvShow the current Perl version and its origin.plvVList all Perl versions available to plenv.plvwDisplay the full path to an executable.plvWList all Perl versions that contain the given executable.plvmList cpan modules in current perl.plvMMigrate cpan modules from other version.plvIInstall cpanm.
Functions
perl-infoexposes information about the Perl environment via the$perl_infoassociative array.
Theming
To display the name of the current Perl version in a prompt, define the
following style in the prompt_name_setup function.
# %v - perl version.
zstyle ':prezto:module:perl:info:version' format 'version:%v'
Then add $perl_info[version] to $PROMPT or $RPROMPT and call
perl-info in the prompt_name_precmd hook function.
Authors
The authors of this module should be contacted via the issue tracker.