Skip to content

Commit 5231996

Browse files
committed
perl backend: more reliable fullpath to Perl
1 parent c443e17 commit 5231996

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

+stdlib/private/executable.pl

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,11 @@
1-
print $^X;
1+
# https://perldoc.perl.org/variables/$%5EX
2+
# we do this instead of $^X to get a full reliable path to Perl
3+
4+
use Config;
5+
my $secure_perl_path = $Config{perlpath};
6+
if ($^O ne 'VMS') {
7+
$secure_perl_path .= $Config{_exe}
8+
unless $secure_perl_path =~ m/$Config{_exe}$/i;
9+
}
10+
11+
print $secure_perl_path

0 commit comments

Comments
 (0)