Created
April 11, 2011 21:49
-
-
Save dolmen/914441 to your computer and use it in GitHub Desktop.
Configure my local Perl environment and tools (Unix)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env perl | |
use strict; | |
use warnings; | |
my $local_lib = $ENV{'HOME'}.'/.perl'; | |
-d $local_lib || -l $local_lib or mkdir $local_lib or die $!; | |
open my $f, '>', "$local_lib/profile" or die $!; | |
print $f <<EOF; | |
# | |
# Add this line to ~/.bash_profile: | |
# . $local_lib/profile | |
# | |
PATH="$local_lib/bin:\$PATH" | |
test -d "$local_lib/man" && MANPATH="$local_lib/man\${MANPATH:+:}\${MANPATH}" | |
PERL5LIB="$local_lib/lib/perl5\${PERL5LIB:+:}\${PERL5LIB}" | |
PERL_CPANM_OPT="-l $local_lib" | |
export PERL5LIB PERL_CPANM_OPT | |
EOF | |
close $f; | |
my %config = ( | |
build_requires_install_policy => 'no', | |
makepl_arg => qq{"INSTALL_BASE=$local_lib"}, | |
mbuildpl_arg => qq{--install_base "$local_lib"}, | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment