perlbench

 view release on metacpan or  search on metacpan

lib/PerlBench/Results.pm  view on Meta::CPAN

    # fill in additional information about hosts and perls
    while(my($hostname, $hosthash) = each %{$self->{h} || {}}) {
	#print "host $hostname\n";
	while (my($perl, $perlhash) = each %{$hosthash->{p}}) {
	    #print " perl $perl\n";
	    my $perldir = "$dir/$hostname/perls/$perl";
	    my $version_txt = "$perldir/version.txt";
	    open(my $fh, "<", $version_txt) || die "Can't open $version_txt: $!";
	    local($_);
	    while (<$fh>) {
		if (/^This is perl, v(\S+)/) {
		    $perlhash->{version} = $1;
		    $perlhash->{name} = "perl-$1";
		}
		if (/^Binary build (\d+.*) provided by ActiveState/) {
		    $perlhash->{name} .= " build $1";
		    $perlhash->{name} =~ s/^perl/ActivePerl/;
		}
	    }
	    die "Can't determine perl version from $version_txt" unless $perlhash->{version};
	    close($fh);

perlbench-run  view on Meta::CPAN

	$label = $1;
    }
    else {
	$label = $NEXT_LABEL++;
    }
    unless (-x $path) {
	die "$path is not executable";
	next;
    }
    my $self = bless { path => $path, label => $label }, $class;
    $self->run_cmd(*V, '-e', 'print qq(This is perl ), $]+0, qq(\n)');
    my $version = <V>;
    close V or die "closing pipe from perl: exit code $?";
    chomp $version;
    unless ($version =~ /^This is perl (\d+.\d+)/) {
	die "$path does not appear to be a working perl";
    }
    $self->{version} = $1;
    $self->run_cmd(*V, '-v');
    while (<V>) {
	if (/^This is perl, v(\S+)/) {
	    $self->{name} = "perl-$1";
	}
	if (/^Binary build (\d+.*) provided by ActiveState/) {
	    $self->{name} .= " build $1";
	    $self->{name} =~ s/^perl/ActivePerl/;
	}
    }
    close(V);

    if ($self->{version} >= 5) {



( run in 1.021 second using v1.01-cache-2.11-cpan-49f99fa48dc )