Skip to content

Instantly share code, notes, and snippets.

@dolmen
Created April 11, 2011 21:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dolmen/914441 to your computer and use it in GitHub Desktop.
Save dolmen/914441 to your computer and use it in GitHub Desktop.
Configure my local Perl environment and tools (Unix)
#!/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