prezto_config/modules/perl/init.zsh

54 lines
1,003 B
Bash
Raw Normal View History

2012-02-01 05:37:51 +01:00
#
# Enables local Perl module installation on Mac OS X and defines aliases.
#
# Authors:
# Sorin Ionescu <sorin.ionescu@gmail.com>
#
2012-07-23 21:00:44 +02:00
# Return if requirements are not found.
if (( ! $+commands[perl] )); then
return 1
fi
2012-08-04 20:48:32 +02: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
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
2012-08-04 20:48:32 +02:00
#
2011-08-28 21:28:09 +02:00
# Aliases
2012-08-04 20:48:32 +02:00
#
2012-06-13 01:16:59 +02:00
# General
2012-08-14 02:05:30 +02:00
alias pl='perl'
alias pld='perldoc'
alias ple='perl -wlne'
2012-06-13 01:16:59 +02:00
# Perlbrew
2012-08-14 02:05:30 +02:00
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'
2011-03-14 06:43:33 +01:00