Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Handle multiple Perl local::lib paths
# Defaults:
PERL_LOCAL_LIB="home"
DIR=$HOME/.perl
if [ -n "$1" ]; then
PERL_LOCAL_LIB=$1
fi
export PERL_LOCAL_LIB
case $PERL_LOCAL_LIB in
alpha)
DIR=$HOME/projects/alpha/ ;;
mercury)
DIR=$HOME/subversion/mercury/perl ;;
tmp)
mkdir -p /tmp/makholm/perl
DIR=/tmp/makholm/perl ;;
esac
eval $( perl -Mlocal::lib=$DIR )
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment