In that case, Brother Salva's answer is the one you want. In this case, using $^X will work, but in general it's good practice to use Config; and then use $Config{perlpath} instead. $^X can sometimes get confused if your original script is invoked with a relative path to perl (eg as ../myperl/bin/perl foo.pl) and then does a chdir before you try to execute $^X, and on some more exotic platforms.
Strictly speaking, you should also pay attention to $Config{exe_ext} as well, sticking it on the end of $Config{perlpath} if it's not already there, but given that you're only on Unix you don't need to care about that.
|