From 5458c2a78f930c202508ff0e66764a0aa83d4df6 Mon Sep 17 00:00:00 2001 From: Sorin Ionescu Date: Sun, 28 Aug 2011 15:29:56 -0400 Subject: [PATCH] Added local CPAN module installation for Mac OS X. --- plugins/perl/perl.plugin.zsh | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/plugins/perl/perl.plugin.zsh b/plugins/perl/perl.plugin.zsh index 05f2a224..ff5230a0 100644 --- a/plugins/perl/perl.plugin.zsh +++ b/plugins/perl/perl.plugin.zsh @@ -1,3 +1,30 @@ +# For Perl older than 5.10.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 +# +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 + export MANPATH="$perl_path/man:$MANPATH" + if [[ ! -f "$cache_file" ]]; then + perl -I$perl_path/lib/perl5 -Mlocal::lib=$perl_path >! "$cache_file" + source "$cache_file" + else + source "$cache_file" + fi + fi + unset perl_path + unset cache_file +fi + # Aliases alias pbi='perlbrew install' alias pbl='perlbrew list'