Subject: | Generated 'compile.t' test fails on systems with multiple Perls |
The 't/compile.t' test generated by scriptdist hard-codes the name of
the Perl interpreter to 'perl'. This means that the test will always try
to use the first 'perl' in the user's path, which may not be the Perl
that the user is trying to install against.
Instead, the test should be written to use $^X instead, i.e:
$Content{"t/compile.t"} = <<"COMPILE_T";
# \$Id\$
use Test::More tests => 1;
my \$file = "blib/script/$$hash{script}";
print "bail out! Script file is missing!" unless -e \$file;
my \$output = `\$^X -c \$file 2>&1`;
print "bail out! Script file is missing!" unless
like( \$output, qr/syntax OK\$/, 'script compiles' );
COMPILE_T