in reply to Avoiding Hardcoded path of Perl.exe in coding
Just use $^X, which contains the currently running Perl executable. You'll need to properly quote it if you're interpolating it into a command line, if $^X contains whitespace:
my $perl = $^X; $perl = qq{"$perl"} if $perl =~ /\s/;
|
|---|