1
0
Fork 0
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
prezto/modules/perl/init.zsh

63 lines
1.3 KiB

#
# Enables local Perl module installation on Mac OS X and defines aliases.
#
# Authors:
# Sorin Ionescu <sorin.ionescu@gmail.com>
# Patrick Baker <patricksbaker@gmail.com>
#
#
# Perlbrew
#
zstyle -s ':prezto:module:perl:perlbrew' location '_perlbrew_root'
_perlbrew_root_expanded=${(j::)~_perlbrew_root}
if [[ -s "${_perlbrew_root}/etc/bashrc" ]]; then
export PERLBREW_ROOT="${_perlbrew_root}"
source "${_perlbrew_root}/etc/bashrc"
unset _perlbrew_root
unset _perlbrew_root_expanded
fi
#
# Local Module Installation
#
if [[ "$OSTYPE" == darwin* ]] && (( $+commands[perl] )); then
# Perl is slow; cache its output.
cache_file="${0:h}/cache.zsh"
perl_path="$HOME/Library/Perl/5.12"
if [[ -f "$perl_path/lib/perl5/local/lib.pm" ]]; then
if [[ ! -s "$cache_file" ]]; then
perl -I$perl_path/lib/perl5 -Mlocal::lib=$perl_path >! "$cache_file"
fi
source "$cache_file"
fi
unset perl_path
unset cache_file
fi
#
# Aliases
#
# General
alias pl='perl'
alias pld='perldoc'
alias ple='perl -wlne'
# Perlbrew
alias plb='perlbrew'
alias plba='perlbrew available'
alias plbi='perlbrew install'
alias plbl='perlbrew list'
alias plbo='perlbrew off'
alias plbO='perlbrew switch-off'
alias plbs='perlbrew switch'
alias plbu='perlbrew use'
alias plbx='perlbrew uninstall'