in reply to perl install prefix as an env variable

I use this little bit at the start of my scripts, as I run them on my local box with $HOME/tools/perl, and on the HP servers as /opt/perl5/bin/perl.

#!/bin/sh PATH=$HOME/perl/bin:$HOME/tools:/opt/perl5/bin:/usr/local/bin:$PATH export PATH exec perl -S -w -x $0 ${1+"$@"} #! perl -w #line 8

I got this one straight from perlrun. The same should work for you, but just change the $PATH to include the preferred perl version first.

Replies are listed 'Best First'.
Re: Re: perl install prefix as an env variable
by Anonymous Monk on Mar 13, 2002 at 20:07 UTC
    That is what I have been more or less doing, I'm just wondering if there is a way to do that when running the ./Configure file. ie some way to --prefix=$VARIABLE and have the variable stay through the build and not be substituted (and be an env variable)

      D'oh... Gotta start reading before replying.

      Can you use ./Configure -d -Dprefix=~/perl -Uinstallusrbinperl ??

      Or perhaps ./Configure -d -Dprefix="$ENV_VAR" -Uinstallusrbinperl

      Warning: not tested