7 $0 --logs=megainstalldir
9 looks at one dirent that tells us which perl we are talking about
11 Ask that perl for its config and store it as perl-V.txt
25 "Usage: $0 [--logs=logsdirector]";
28 GetOptions
(\
%Opt, "logs=s"
31 my $logdir = $Opt{logs
} || "$FindBin::Bin/../logs";
32 opendir my $dh, $logdir or die "cannot opendir '$logdir': $!";
34 my $p = XML
::LibXML
->new;
35 for my $dirent (sort readdir $dh) {
36 next if $dirent =~ /^\./;
37 my $abs = "$logdir/$dirent";
38 next unless $abs =~ /(?:^|\/)megainstall\
.(\d
+T\d
+)\
.d
(?
:\
/|$)/;
40 my $xfile = sprintf "%s/%s", $logdir, $dirent;
41 next unless $xfile =~ /\.xml$/;
42 next unless -e
$xfile;
43 my $xml = $p->parse_file($xfile);
45 $ok = $xml->findvalue("/distro/\@ok");
46 $seq = $xml->findvalue("/distro/\@seq") || 0;
47 $perl = $xml->findvalue("/distro/\@perl");
50 die "perl[$perl] n'exists";
52 open my $fh, ">", "$logdir/perl-V.txt" or die "Could not open >$logdir/perl-V.txt: $!";
53 open my $pfh, "-|", $perl, "-V" or die "cannot fork: $!";
57 close $pfh or die "perl died during -V";
58 close $fh or die "could not write: $!";