>>>>> On Tue, 10 Jul 2007 01:40:31 -0700, Michael G Schwern <[EMAIL PROTECTED]>
>>>>> said:
> Maybe the solution is as simple as:
> eval "use version $VERSION";
> if ( $@ or !_verify( version->new($Some_Version) ) ) {
Not that easy but indeed I found a working solution simply from
hearing your positive voice...Schwern++
Here it is and the comments explain for what's up. I have './Build
test'-ed with 5.6.2, 5.8.0, 5.8.1, 5.8.3, 5.8.7, 5.8.8, 5.8.9-tobe
(@31162), [EMAIL PROTECTED] as well as four in the middle of the
"corridor": 23190, 24139, 25125, 25414
I hope this can go into Module::Build.
Index: lib/Module/Build/Base.pm
===================================================================
--- lib/Module/Build/Base.pm (Revision 9738)
+++ lib/Module/Build/Base.pm (Arbeitskopie)
@@ -1185,7 +1185,9 @@
# Check the current perl interpreter
# It's much more convenient to use $] here than $^V, but 'man
# perlvar' says I'm not supposed to. Bloody tyrant.
- return $^V ? $self->perl_version_to_float(sprintf "%vd", $^V) : $];
+ my $vd = eval { sprintf "%vd", $^V }; # broken in [EMAIL PROTECTED]
+ return $] if $@;
+ return $^V ? $self->perl_version_to_float($vd) : $];
}
sub perl_version_to_float {
Index: lib/Module/Build/PPMMaker.pm
===================================================================
--- lib/Module/Build/PPMMaker.pm (Revision 9738)
+++ lib/Module/Build/PPMMaker.pm (Arbeitskopie)
@@ -127,9 +127,21 @@
my ($self, $config) = @_;
my $varchname = $config->{archname};
# Append "-5.8" to architecture name for Perl 5.8 and later
- if (defined($^V) && ord(substr($^V,1)) >= 8) {
- $varchname .= sprintf("-%d.%d", ord($^V), ord(substr($^V,1)));
+ my $ord_substr_v1 = eval { ord(substr($^V,1)) };
+ if ($@) {
+ # broken in [EMAIL PROTECTED]
+ $ord_substr_v1 = int(1000*($] - int($])));
+ $@ = '';
}
+ my $ord_v = eval { ord($^V) };
+ if ($@) {
+ # broken in [EMAIL PROTECTED]
+ $ord_v = int($]);
+ $@ = '';
+ }
+ if (defined($^V) && $ord_substr_v1 >= 8) {
+ $varchname .= sprintf("-%d.%d", $ord_v, $ord_substr_v1);
+ }
return $varchname;
}
--
andreas