in reply to Re^2: Dynamically choosing the perl path
in thread Dynamically choosing the perl path

Use symlinks on the clients. Change the shebang line to the fixed location of the symlink (#!/usr/local/bin/my-shiny-perl in my example). Make the symlink point to the perl interpreter you want to use. It does not matter where the interpreter is installed (locally or on the NFS server).

$^O happens when perl is already running, so that's too late. You choose perl by the local symlink.

Of course, you can have some kind of installer script that actually creates the local symlink. Something like this (untested):

#!/usr/bin/env perl # ^-- use any perl available use strict; use warnings; my $shinyperl=($^O eq 'linux') ? '/nfs/linux/bin/perl' : '/nfs/aix/bin +/perl'; symlink($shinyperl,'/usr/local/bin/my-shiny-perl') or die "Create syml +ink failed: $!";

Alexander

--
Today I will gladly share my knowledge and experience, for there are no sweeter words than "I told you so". ;-)