#!/usr/bin/perl
# perl-module-install -- install module at specified directory

use strict;
use warnings;

use CPAN;
use Getopt::Long qw(:config gnu_getopt);

my %opts = ();

GetOptions( \%opts,
			'install-base-dir|d=s' )
  or die("$!");

exists $opts{'install-base-dir'}
  or die("$0: --install-base-dir is required");

eval 'use local::lib $opts{"install-base-dir"}';
die($@) if ($@);

for my $pkg (@ARGV) {
  CPAN::install($pkg);
}

