summaryrefslogtreecommitdiff
path: root/pod/perllocale.pod
diff options
context:
space:
mode:
authorKarl Williamson <khw@cpan.org>2014-05-15 15:40:51 -0600
committerKarl Williamson <khw@cpan.org>2014-06-05 11:22:59 -0600
commita835cd471aa3ec6d80861d44cf239be1856e2f66 (patch)
tree1272258cf0b1fa0a0567a3235ec1771cb0a40a31 /pod/perllocale.pod
parent6bf09f5529fd48ed68cd24ebb1944176d9cbfc8e (diff)
downloadperl-a835cd471aa3ec6d80861d44cf239be1856e2f66.tar.gz
Localeconv() should be independent of 'use locale'
localeconv() should return the values for the underlying locale of the program regardless of whether the calling place is within the scope of "use locale" or not. Otherwise, it makes no sense to call it from outside such scope, and a pure perl module that calls it on behalf of a caller would likely get it wrong. In earlier versions of Perl the LC_NUMERIC category was initialized to C, but was changed by the first setlocale() anywhere in the process. It is rare to call localeconv() without first having done a setlocale(). But to solve other bugs, future commits will keep LC_NUMERIC in the C locale except during such operations where it should be the underlying locale. localeconv() is such a place, so this commit is being done before the later ones so it doesn't break.
Diffstat (limited to 'pod/perllocale.pod')
-rw-r--r--pod/perllocale.pod4
1 files changed, 3 insertions, 1 deletions
diff --git a/pod/perllocale.pod b/pod/perllocale.pod
index cb36640c24..3a5c811c75 100644
--- a/pod/perllocale.pod
+++ b/pod/perllocale.pod
@@ -621,7 +621,9 @@ because these things are not that standardized.
The C<POSIX::localeconv()> function allows you to get particulars of the
locale-dependent numeric formatting information specified by the current
-C<LC_NUMERIC> and C<LC_MONETARY> locales. (If you just want the name of
+underlying C<LC_NUMERIC> and C<LC_MONETARY> locales (regardless of
+whether called from within the scope of C<S<use locale>> or not). (If
+you just want the name of
the current locale for a particular category, use C<POSIX::setlocale()>
with a single parameter--see L<The setlocale function>.)