Installing to a consistent local folder is doable but requires a bit of research, mostly because of differences between Module::Build and ExtUtils::MakeMaker.

At work I need to install a large number of modules locally as a non-root user and I quickly got tired of the manual build process. Behind the 'readmore' tags is the current version of a bash script I wrote to automate this process. After I clean it up and check for existing implementations I'll post it if people find it useful.

#!/bin/bash # usage: pminstall [-f] <tarball|directory> # Example: pminstall foo.tgz # Author: Christopher Clark <perlmonkey@gmail.com> # The actual installation is handled in do_install, the rest of this s +cript is devoted to # determining where to run the install commands. # function usage { echo "Usage: $0 <tarball|directory> <installation path>" echo "Examples:" echo " $0 Foo-1.1.tgz Bar-* ~/local" echo " $0 Foo-1.1/ ~/local" } if [ "$#" -lt "2" ]; then usage exit 1 fi function real_install { base=$1 echo if [ "$PMINSTALL_NODELAY" = "" ]; then echo -n Installing to $base/ in 3 sleep 1 && echo -ne "\b2" sleep 1 && echo -ne "\b1" echo -e "\b\b\b\b " else echo Installing to $base/ fi perl Makefile.PL PREFIX=$base LIB=$base/lib && make && make test && +make pure_install } function do_install { force=$1 file=$2 base=$3 # Exit if the specified file is neither a file nor a directory if [ ! -d "$file" -a ! -f "$file" ]; then echo "Invalid file '$file'" exit fi if [ "$base" = "" ]; then usage exit 1 fi # If the specified file is a directory we can simply change to that di +rectory and run real_install if [ -d "$file" ]; then cd $file real_install $base return fi # If the specified module is a file, then it must be unzipped if [ -f "$file" ]; then # The install should be done in a sandbox directory, in case the tar +ball doesn't have a subdirectory [ -d sandbox ] || mkdir sandbox cd sandbox # Identify the top level directory in the tarball.. this isn't a ter +ribly robust method # But it shouldn't really need to be top_dir=`tar -tzf ../$file | awk '/\// {print}' | sed 's/\/.*$//' | +sort -u` #echo "top level dir = $top_dir" # if the top level directory is empty we'll stay in the sandbox if [ "$top_dir" = "" ]; then tar -xzf ../$file # Otherwise we'll change to that directory else tar -xzf ../$file cd $top_dir fi real_install $base return; fi } ############## Actual start of the script #Find the last argument - this is our destination folder for file in $*; do dest=$file; done; if [[ ! "$dest" =~ '^/' ]]; then dest="$PWD/$dest" fi idx=1 stop=$(($# -1)) force=0 start_dir=`pwd` for file in $*; do if [ "$idx" -gt "$stop" ]; then break; fi if [ "$file" = "-f" ]; then force=1 idx=$(($idx + 1)) continue fi cd $start_dir echo -e "\n----- Installing $file to $dest/" do_install $force $file $dest idx=$(($idx + 1)) done
Update - After having my first coffee of the day I re-read the OP and noticed the 'C:\'. Bash scripts typically aren't useful on windows, so ignore this post.

In reply to Re^4: Specifying .pm files by imp
in thread Specifying .pm files by mantra2006

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.