Skip to content

Commit c8ad266

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

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+
# $^X may be relative, so we need to resolve it to an absolute path
3+
# we do not use $Config{perlpath} as that's a build-time variable and is thus
4+
# incorrect when a buildbot was used e.g. Windows Perl from Matlab
5+
#
6+
# https://perldoc.perl.org/Cwd#abs_path
7+
# abs_path is effectively realpath(3)
8+
9+
use Cwd 'abs_path';
10+
11+
print abs_path($^X);

0 commit comments

Comments
 (0)