1
0
mirror of https://github.com/dcarrillo/prezto.git synced 2024-11-16 09:41:12 +00:00
prezto/modules/perl/init.zsh

61 lines
1.2 KiB
Bash
Raw Normal View History

2012-02-01 04:37:51 +00:00
#
# Enables local Perl module installation on Mac OS X and defines aliases.
#
# Authors:
# Sorin Ionescu <sorin.ionescu@gmail.com>
#
2012-07-23 19:00:44 +00:00
# Return if requirements are not found.
if (( ! $+commands[perl] )); then
return 1
fi
2012-08-04 18:48:32 +00:00
#
# Local Module Installation
#
if [[ "$OSTYPE" == darwin* ]]; 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
manpath=("$perl_path/man" $manpath)
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
# Set environment variables for launchd processes.
for env_var in PERL_LOCAL_LIB_ROOT PERL_MB_OPT PERL_MM_OPT PERL5LIB; do
launchctl setenv "$env_var" "${(P)env_var}" &!
done
unset env_var
fi
2012-08-04 18:48:32 +00:00
#
2011-08-28 19:28:09 +00:00
# Aliases
2012-08-04 18:48:32 +00:00
#
2012-06-12 23:16:59 +00:00
# General
alias pd='perldoc'
alias pe='perl -wlne'
# Perlbrew
2012-06-12 23:20:03 +00:00
alias pb='perlbrew'
alias pba='perlbrew available'
2011-03-14 05:43:33 +00:00
alias pbi='perlbrew install'
alias pbl='perlbrew list'
alias pbo='perlbrew off'
2012-06-12 23:20:03 +00:00
alias pbO='perlbrew switch-off'
2011-03-14 05:43:33 +00:00
alias pbs='perlbrew switch'
alias pbu='perlbrew use'
2012-06-12 23:20:03 +00:00
alias pbx='perlbrew uninstall'
2011-03-14 05:43:33 +00:00