Coerce PERL_VERSION with %vd to fix 5.8.

This commit is contained in:
Daniel Nichter
2012-08-08 15:23:52 -06:00
parent c755700068
commit ff7aebaa0e
2 changed files with 18 additions and 0 deletions

View File

@@ -171,6 +171,14 @@ sub get_perl_variable {
my $item = $args{item};
return unless $item;
# Can't just stringify $PERL_VERSION because on 5.8 it doesn't work.
# So %vd coerces the version into a string on 5.8+.
if ( $item->{item} eq 'Perl' ) {
my $version = sprintf '%vd', $PERL_VERSION;
PTDEBUG && _d('Perl version', $version);
return $version;
}
# If there's a var, then its an explicit Perl variable name to get,
# else the item name is an implicity Perl module name to which we
# append ::VERSION to get the module's version.

View File

@@ -46,6 +46,16 @@ sub test_v {
"$args{name} versions"
);
# Perl 5.8 $^V/$PERL_VERSION is borked, make sure
# the module is coping with it.
if ( $items->{Perl} ) {
like(
$versions->{Perl},
q/\d+\.\d+.\d+/,
"Perl version looks like a version"
);
}
return;
}