Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re^3: different exe path for different OS

by DrHyde (Prior)
on Sep 02, 2010 at 10:13 UTC ( [id://858537] : note . print w/replies, xml ) Need Help??


in reply to Re^2: different exe path for different OS
in thread different exe path for different OS

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.