LA.pm: Hi & ?

Rosie Jones rosie+ at cs.cmu.edu
Sat Feb 9 17:20:37 CST 2002


What I generally do is what Samy suggested; give make an argument throught
the Makefile.pl file:

perl Makefile.pl LIB=/home/me/perlinstalldir/

then do all of 
 make
 make test
and 
 make install

and make install puts everything into /home/me/perlinstalldir/

Then in the BEGIN block of my perl scripts I put:

# @INC has the places perl looks for modules
unshift @INC, ("/home/me/perlinstalldir/", "/home/me/perlinstalldir/i686-linux/");


More generally, in case I have modules or handy little scripts etc
installed in the same directory as the script itself, my begin block looks
something like this:

BEGIN {
    $perlinstalldir = "/home/me/perlinstalldir/";
    $mypath = $0; # see where this perl script lives
    @dirs = split(/\//, $mypath); # unix-specific
    pop(@dirs); # strip of the name of the script
    if (@dirs) { $mypath = join('/', @dirs); } # put the path back
                                               # together
    else { $mypath = "."; } # or use . if we didn't have a whole path
    # these modules aren't available in the main distribution
    unshift @INC, ($perlinstalldir, "$perlinstalldir/i686-linux/", 
$mypath);

}

Rosie.




More information about the Losangeles-pm mailing list