jakeiii
11-02-2007, 06:01 AM
I'm trying to learn the best way to manage having different perl locations on different servers. I like to test my CGI Perl scripts on my own laptop, work computer and actual site, but they all have different locations for perl. Currently, I deal with this by adding the following to the beginning of each perl script.
#! /bin/sh
if [ `uname -n` = "-- computer name --" ]
then
eval ' exec /sw/perl/5.6.1/WS/7/bin/perl -x $0 "$@" '
else
eval ' exec /usr/bin/perl -x $0 "$@" '
fi
#! perl
Is there a better way to deal with this? Perhaps within perl rather than relying on /bin/sh ?
TIA
Jake
#! /bin/sh
if [ `uname -n` = "-- computer name --" ]
then
eval ' exec /sw/perl/5.6.1/WS/7/bin/perl -x $0 "$@" '
else
eval ' exec /usr/bin/perl -x $0 "$@" '
fi
#! perl
Is there a better way to deal with this? Perhaps within perl rather than relying on /bin/sh ?
TIA
Jake