6 use POSIX qw/WIFEXITED WEXITSTATUS EXIT_FAILURE/;
9 no warnings 'redefine';
11 *WIFEXITED = sub { 1 } unless eval { WIFEXITED(0); 1 };
12 *WEXITSTATUS = sub { shift() >> 8 } unless eval { WEXITSTATUS(0); 1 };
17 my $args_dat = './args.dat';
19 open my $fh, '<', $args_dat or die "open(<$args_dat): $!";
27 s{\[([0-9]+)\]}{chr $1}ge;
31 my $ret = EXIT_FAILURE;
33 sub CwdSaver::DESTROY {
34 my $cwd = $_[0]->{cwd};
35 chdir $cwd or die "chdir('$cwd'): $!";
38 my $guard = bless { cwd => do { require Cwd; Cwd::cwd() } }, 'CwdSaver';
40 chdir 't/re-engine-Hooks-TestDist'
41 or die "chdir('t/re-engine-Hooks-TestDist'): $!";
43 system { $^X } $^X, 'Makefile.PL', @args;
45 die "$^X Makefile.PL @args: $!";
46 } elsif (WIFEXITED($?)) {
47 $ret = WEXITSTATUS($?);