From aa2bc4d385298947b20667efc390d3182feaebe1 Mon Sep 17 00:00:00 2001 From: Karl Williamson Date: Tue, 14 Nov 2017 21:33:43 -0700 Subject: [PATCH] POSIX.pod: Add cautions about locale use --- ext/POSIX/lib/POSIX.pod | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/ext/POSIX/lib/POSIX.pod b/ext/POSIX/lib/POSIX.pod index 0d7a1a0..712132b 100644 --- a/ext/POSIX/lib/POSIX.pod +++ b/ext/POSIX/lib/POSIX.pod @@ -939,6 +939,9 @@ containing the current underlying locale's formatting values. Users of this fun should also read L, which provides a comprehensive discussion of Perl locale handling, including L. +It should not be used in a threaded application unless it's certain that +the underlying locale is C or POSIX. This is because it otherwise +changes the locale, which globally affects all threads simultaneously. Here is how to query the database for the B (Deutsch or German) locale. @@ -1804,7 +1807,10 @@ may not check for overflow, and therefore will never set C<$!>. C respects any POSIX C C settings, regardless of whether or not it is called from Perl code that is within -the scope of S>. +the scope of S>. This means it should not be used in a +threaded application unless it's certain that the underlying locale is C +or POSIX. This is because it otherwise changes the locale, which +globally affects all threads simultaneously. To parse a string C<$str> as a floating point number use -- 1.8.3.1