Skip Menu |

This queue is for tickets about the version CPAN distribution.

Report information
The Basics
Id: 119669
Status: resolved
Priority: 0/
Queue: version

People
Owner: Nobody in particular
Requestors: VDB [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: 0.9917
Fixed in: (no value)



Subject: [Feature Request] Make variables $STRICT_DECIMAL_VERSION etc publicly accessible
version/regex.pm module defines only two variables which can be used outside: $STRICT and $LAX. I would be nice if version/regex.pm allows using few more variables, namely: $STRICT_DECIMAL_VERSION, $STRICT_DOTTED_DECIMAL_VERSION, $LAX_DECIMAL_VERSION, and $LAX_DOTTED_DECIMAL_VERSION.
Subject: version-regex-public.patch
diff -r 2e2892f29539 lib/version/regex.pm --- a/lib/version/regex.pm Sun May 29 07:50:12 2016 -0400 +++ b/lib/version/regex.pm Tue Jan 03 15:37:36 2017 +0300 @@ -2,7 +2,11 @@ use strict; -use vars qw($VERSION $CLASS $STRICT $LAX); +use vars qw( + $VERSION $CLASS $STRICT $LAX + $STRICT_DECIMAL_VERSION $STRICT_DOTTED_DECIMAL_VERSION + $LAX_DECIMAL_VERSION $LAX_DOTTED_DECIMAL_VERSION +); $VERSION = 0.9917; @@ -57,13 +61,13 @@ # Strict decimal version number. -my $STRICT_DECIMAL_VERSION = +$STRICT_DECIMAL_VERSION = qr/ $STRICT_INTEGER_PART $FRACTION_PART? /x; # Strict dotted-decimal version number. Must have both leading "v" and # at least three parts, to avoid confusion with decimal syntax. -my $STRICT_DOTTED_DECIMAL_VERSION = +$STRICT_DOTTED_DECIMAL_VERSION = qr/ v $STRICT_INTEGER_PART $STRICT_DOTTED_DECIMAL_PART{2,} /x; # Complete strict version number syntax -- should generally be used @@ -80,7 +84,7 @@ # allowing an alpha suffix or allowing a leading or trailing # decimal-point -my $LAX_DECIMAL_VERSION = +$LAX_DECIMAL_VERSION = qr/ $LAX_INTEGER_PART (?: $FRACTION_PART | \. )? $LAX_ALPHA_PART? | $FRACTION_PART $LAX_ALPHA_PART? @@ -92,7 +96,7 @@ # enough, without the leading "v", Perl takes .1.2 to mean v0.1.2, # so when there is no "v", the leading part is optional -my $LAX_DOTTED_DECIMAL_VERSION = +$LAX_DOTTED_DECIMAL_VERSION = qr/ v $LAX_INTEGER_PART (?: $LAX_DOTTED_DECIMAL_PART+ $LAX_ALPHA_PART? )? |
Thanks, applied, with additional tests and added them to version:: class as references.