summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorKarl Williamson <public@khwilliamson.com>2013-06-17 22:04:47 -0600
committerKarl Williamson <public@khwilliamson.com>2013-06-17 23:25:21 -0600
commit68e8f474bc686a86c064b695b9c7400313d7af65 (patch)
treebf191fb1370166eaddb877a48eb321d2937a1c3a /lib
parentb127e37e51c21b0a36755dcd19811be931a03d83 (diff)
downloadperl-68e8f474bc686a86c064b695b9c7400313d7af65.tar.gz
Don't use locale definitions unless within scope
Prior to this patch, stringification of an NV used the current locale's decimal point character, even outside the scope of a 'use locale'. This is contrary to the documentation (though one example in perllocale omitted the 'use locale') and can lead to unexpected results. There was one test in the core that relied on the old behavior, and maybe more in CPAN. This patch is being made early in 5.19 to see what breaks. I do believe though that any breakage is trumped by the principal that locale rules should only be used if locales are explicitly requested.
Diffstat (limited to 'lib')
-rw-r--r--lib/version/t/07locale.t3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/version/t/07locale.t b/lib/version/t/07locale.t
index 2628c4653e..784bc116b7 100644
--- a/lib/version/t/07locale.t
+++ b/lib/version/t/07locale.t
@@ -20,6 +20,8 @@ SKIP: {
# test locale handling
my $warning;
+ use locale;
+
local $SIG{__WARN__} = sub { $warning = $_[0] };
my $ver = 1.23; # has to be floating point number
@@ -61,6 +63,7 @@ SKIP: {
(my $package = basename($filename)) =~ s/\.pm$//;
print $fh <<"EOF";
package $package;
+use locale;
use POSIX qw(locale_h);
\$^W = 1;
use version;