FAQ
This patch should be applied as soon as practical, as it improves the v-string
detection in Perl releases from 5.6.x through 5.8.0 (inclusive). It is not
required for the 5.10.2 release (though I wouldn't cry if it were included
anyways, just to be consistent, since 5.10.2 should ship with version.pm 0.78).

I have an in-progress patch to deal with multiple underscores in version
initialization, so if that lands before this gets applied, I'll provide a new patch.

John

--- lib/Module/Build/Version.pm (revision 2870)
+++ lib/Module/Build/Version.pm (local)
@@ -121,8 +121,7 @@
use POSIX qw/locale_h/;
use locale;
use vars qw ($VERSION @ISA @REGEXS);
-$VERSION = '0.77';
-$VERSION = eval $VERSION;
+$VERSION = 0.78;

push @REGEXS, qr/
^v? # optional leading 'v'
@@ -613,9 +612,10 @@
sub _un_vstring {
my $value = shift;
# may be a v-string
- if ( $] >= 5.006_000 && length($value) >= 3 && $value !~ /[._]/ ) {
+ if ( $] >= 5.006_000 && length($value) >= 3 && $value !~ /[._]/
+ && (ord($value) < ord('0') || ord($value) > ord('9')) ) {
my $tvalue = sprintf("v%vd",$value);
- if ( $tvalue =~ /^v\d+\.\d+\.\d+$/ ) {
+ if ( $tvalue =~ /^v\d+(\.\d+){2,}$/ ) {
# must be a v-string
$value = $tvalue;
}

Search Discussions

  • David Golden at Nov 26, 2009 at 2:43 pm
    This will go in after 0.36, as I'm currently doing (hopefully final)
    release candidate testing. I'll forward your email to RT so it doesn't
    get lost.

    David


    On Thu, Nov 26, 2009 at 9:08 AM, John Peacock
    wrote:
    This patch should be applied as soon as practical, as it improves the v-string
    detection in Perl releases from 5.6.x through 5.8.0 (inclusive).  It is not
    required for the 5.10.2 release (though I wouldn't cry if it were included
    anyways, just to be consistent, since 5.10.2 should ship with version.pm 0.78).

    I have an in-progress patch to deal with multiple underscores in version
    initialization, so if that lands before this gets applied, I'll provide a new patch.

    John

    --- lib/Module/Build/Version.pm (revision 2870)
    +++ lib/Module/Build/Version.pm (local)
    @@ -121,8 +121,7 @@
    use POSIX qw/locale_h/;
    use locale;
    use vars qw ($VERSION @ISA @REGEXS);
    -$VERSION = '0.77';
    -$VERSION = eval $VERSION;
    +$VERSION = 0.78;

    push @REGEXS, qr/
    ^v?     # optional leading 'v'
    @@ -613,9 +612,10 @@
    sub _un_vstring {
    my $value = shift;
    # may be a v-string
    -    if ( $] >= 5.006_000 && length($value) >= 3 && $value !~ /[._]/ ) {
    +    if ( $] >= 5.006_000 && length($value) >= 3 && $value !~ /[._]/
    +       && (ord($value) < ord('0') || ord($value) > ord('9')) ) {
    my $tvalue = sprintf("v%vd",$value);
    -       if ( $tvalue =~ /^v\d+\.\d+\.\d+$/ ) {
    +       if ( $tvalue =~ /^v\d+(\.\d+){2,}$/ ) {
    # must be a v-string
    $value = $tvalue;
    }

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupmodule-build @
categoriesperl
postedNov 26, '09 at 2:08p
activeNov 26, '09 at 2:43p
posts2
users2
websitecpan.org...

2 users in discussion

John Peacock: 1 post David Golden: 1 post

People

Translate

site design / logo © 2018 Grokbase