use vars qw(@ISA $VERSION $CLASS $STRICT $LAX *declare *qv);
-$VERSION = 0.9918;
+$VERSION = 0.9921;
$CLASS = 'version';
# avoid using Exporter
=head2 numify()
-Returns a value representing the object in a pure decimal form without
-trailing zeroes.
+Returns a value representing the object in a pure decimal.
- version->declare('v1.2')->numify; # 1.002
+ version->declare('v1.2')->numify; # 1.002000
version->parse('1.2')->numify; # 1.200
=head2 stringify()
a version object is interpolated into a string.
version->declare('v1.2')->stringify; # v1.2
- version->parse('1.200')->stringify; # 1.200
+ version->parse('1.200')->stringify; # 1.2
version->parse(1.02_30)->stringify; # 1.023
=head1 EXPORTED FUNCTIONS
$LAX_DECIMAL_VERSION $LAX_DOTTED_DECIMAL_VERSION
);
-$VERSION = 0.9918;
+$VERSION = 0.9921;
#--------------------------------------------------------------------------#
# Version regexp components
)
);
require $coretests;
- use_ok('version', 0.9918);
+ use_ok('version', 0.9921);
}
BaseTests("version","new","qv");
)
);
require $coretests;
- use_ok("version", 0.9918);
+ use_ok("version", 0.9921);
# If we made it this far, we are ok.
}
# Don't want to use, because we need to make sure that the import doesn't
# fire just yet (some code does this to avoid importing qv() and delare()).
require_ok("version");
-is $version::VERSION, 0.9918, "Make sure we have the correct class";
+is $version::VERSION, 0.9921, "Make sure we have the correct class";
ok(!"main"->can("qv"), "We don't have the imported qv()");
ok(!"main"->can("declare"), "We don't have the imported declare()");
}
BEGIN {
- use version 0.9918;
+ use version 0.9921;
}
pass "Didn't get caught by the wrong DIE handler, which is a good thing";
use Test::More qw/no_plan/;
BEGIN {
- use_ok('version', 0.9918);
+ use_ok('version', 0.9921);
}
my $v1 = version->new('1.2');
use Config;
BEGIN {
- use_ok('version', 0.9918);
+ use_ok('version', 0.9921);
}
SKIP: {
#########################
use Test::More tests => 3;
-use_ok("version", 0.9918);
+use_ok("version", 0.9921);
# do strict lax tests in a sub to isolate a package to test importing
SKIP: {
#########################
use strict;
-use_ok("version", 0.9918);
+use_ok("version", 0.9921);
use Test::More;
BEGIN {
perlfaq cpan/perlfaq/lib/perlfaq5.pod bcc1b6af3b6dff3973643acf8d5e741463374123
perlfaq cpan/perlfaq/lib/perlfaq8.pod bffbc0c8fa828aead24e0891a5e789369a8e0743
podlators pod/perlpodstyle.pod c6500c9950b46e8228d4adbc09a3ee2ef23de2d0
-version cpan/version/lib/version.pm bee369df1bd84e09107a90d72ec12c38bcb97cce
-version vxs.inc 8498104713e5ce189602dda55dca38bee780c297
+version cpan/version/lib/version.pm 2325ac992f0be9d765b558a2162ca13a46de256f
+version vxs.inc f26c23f0279fb64c77ad814af906c04930cff81c
#endif
#ifdef USE_LOCALE_NUMERIC
- {
+ {
/* This may or may not be called from code that has switched
* locales without letting perl know, therefore we have to find it
* from first principals. See [perl #121930]. */
else { /* This value indicates to the restore code that we
didn't change the locale */
locale_name_on_entry = NULL;
- }
- }
+ }
+ }
else if (locale_obj_on_entry == PL_underlying_numeric_obj) {
/* Here, the locale appears to have been changed to use the
* program's underlying locale. Just use our mechanisms to
#endif
- if (sv) {
- Perl_sv_catpvf(aTHX_ sv, "%.9" NVff, SvNVX(ver));
- len = SvCUR(sv);
- buf = SvPVX(sv);
- }
- else {
- len = my_snprintf(tbuf, sizeof(tbuf), "%.9" NVff, SvNVX(ver));
- buf = tbuf;
- }
+ if (sv) {
+ Perl_sv_catpvf(aTHX_ sv, "%.9"NVff, SvNVX(ver));
+ len = SvCUR(sv);
+ buf = SvPVX(sv);
+ }
+ else {
+ len = my_snprintf(tbuf, sizeof(tbuf), "%.9"NVff, SvNVX(ver));
+ buf = tbuf;
+ }
#ifdef USE_LOCALE_NUMERIC
}
else if (locale_obj_on_entry != PL_C_locale_obj) {
uselocale(locale_obj_on_entry);
- }
+ }
# endif
SV * tsv = *av_fetch(av, 0, 0);
digit = SvIV(tsv);
}
- sv = Perl_newSVpvf(aTHX_ "v%" IVdf, (IV)digit);
+ sv = Perl_newSVpvf(aTHX_ "v%"IVdf, (IV)digit);
for ( i = 1 ; i <= len ; i++ ) {
SV * tsv = *av_fetch(av, i, 0);
digit = SvIV(tsv);
- Perl_sv_catpvf(aTHX_ sv, ".%" IVdf, (IV)digit);
+ Perl_sv_catpvf(aTHX_ sv, ".%"IVdf, (IV)digit);
}
if ( len <= 2 ) { /* short version, must be at least three */
#if PERL_VERSION_LT(5,27,9)
# define LC_NUMERIC_LOCK
# define LC_NUMERIC_UNLOCK
-# if PERL_VERSION_LT(5,19,0)
-# undef STORE_LC_NUMERIC_SET_STANDARD
-# undef RESTORE_LC_NUMERIC
-# undef DECLARATION_FOR_LC_NUMERIC_MANIPULATION
-# ifdef USE_LOCALE
-# define DECLARATION_FOR_LC_NUMERIC_MANIPULATION char *loc
-# define STORE_NUMERIC_SET_STANDARD()\
- loc = savepv(setlocale(LC_NUMERIC, NULL)); \
- SAVEFREEPV(loc); \
- setlocale(LC_NUMERIC, "C");
-
-# define RESTORE_LC_NUMERIC()\
- setlocale(LC_NUMERIC, loc);
-# else
-# define DECLARATION_FOR_LC_NUMERIC_MANIPULATION
-# define STORE_LC_NUMERIC_SET_STANDARD()
-# define RESTORE_LC_NUMERIC()
-# endif
+# if PERL_VERSION_LT(5,19,0)
+# undef STORE_LC_NUMERIC_SET_STANDARD
+# undef RESTORE_LC_NUMERIC
+# undef DECLARATION_FOR_LC_NUMERIC_MANIPULATION
+# ifdef USE_LOCALE
+# define DECLARATION_FOR_LC_NUMERIC_MANIPULATION char *loc
+# define STORE_NUMERIC_SET_STANDARD()\
+ loc = savepv(setlocale(LC_NUMERIC, NULL)); \
+ SAVEFREEPV(loc); \
+ setlocale(LC_NUMERIC, "C");
+# define RESTORE_LC_NUMERIC()\
+ setlocale(LC_NUMERIC, loc);
+# else
+# define DECLARATION_FOR_LC_NUMERIC_MANIPULATION
+# define STORE_LC_NUMERIC_SET_STANDARD()
+# define RESTORE_LC_NUMERIC()
+# endif
# endif
#endif
#ifndef LOCK_NUMERIC_STANDARD
-#define LOCK_NUMERIC_STANDARD()
+# define LOCK_NUMERIC_STANDARD()
#endif
#ifndef UNLOCK_NUMERIC_STANDARD
-#define UNLOCK_NUMERIC_STANDARD()
+# define UNLOCK_NUMERIC_STANDARD()
+#endif
+
+/* The names of these changed in 5.28 */
+#ifndef LOCK_LC_NUMERIC_STANDARD
+# define LOCK_LC_NUMERIC_STANDARD() LOCK_NUMERIC_STANDARD()
+#endif
+#ifndef UNLOCK_LC_NUMERIC_STANDARD
+# define UNLOCK_LC_NUMERIC_STANDARD() UNLOCK_NUMERIC_STANDARD()
#endif
/* ex: set ro: */
name, SvPVx_nolen_const(req));
#else
Perl_croak(aTHX_
- "%" HEKf " does not define $%"HEKf
+ "%" HEKf " does not define $%" HEKf
"::VERSION--version check failed",
HEKfARG(name), HEKfARG(name));
#endif