4 use File::Basename qw(&basename &dirname);
7 # List explicitly here the variables you want Configure to
8 # generate. Metaconfig only looks for shell variables, so you
9 # have to mention them as if they were shell variables, not
10 # %Config entries. Thus you write
12 # to ensure Configure will look for $Config{startperl}.
14 # This forces PL files to create target in same directory as PL file.
15 # This is so that make depend always knows where to find PL derivatives.
18 my $file = basename($0, '.PL');
19 $file .= '.com' if $^O eq 'VMS';
21 open OUT,">$file" or die "Can't create $file: $!";
23 print "Extracting $file (with variable substitutions)\n";
25 # In this section, perl variables will be expanded during extraction.
26 # You can use $Config{...} to use Configure variables.
28 print OUT <<"!GROK!THIS!";
30 eval 'exec $Config{perlpath} -S \$0 \${1+"\$@"}'
31 if \$running_under_some_shell;
36 my $prove = File::Spec->catfile(File::Spec->catdir(File::Spec->updir,
37 "cpan", "Test-Harness", "bin"), "prove");
39 if (open(PROVE, $prove)) {
43 die "$0: cannot find '$prove'\n";
46 close OUT or die "Can't close $file: $!";
47 chmod 0755, $file or die "Can't reset permissions for $file: $!\n";
48 exec("$Config{'eunicefix'} $file") if $Config{'eunicefix'} ne ':';