1locale(3pm)            Perl Programmers Reference Guide            locale(3pm)
2
3
4

NAME

6       locale - Perl pragma to use or avoid POSIX locales for built-in
7       operations
8

WARNING

10       DO NOT USE this pragma in scripts that have multiple threads active.
11       The locale is not local to a single thread.  Another thread may change
12       the locale at any time, which could cause at a minimum that a given
13       thread is operating in a locale it isn't expecting to be in.  On some
14       platforms, segfaults can also occur.  The locale change need not be
15       explicit; some operations cause perl to change the locale itself.  You
16       are vulnerable simply by having done a "use locale".
17

SYNOPSIS

19           @x = sort @y;      # Native-platform/Unicode code point sort order
20           {
21               use locale;
22               @x = sort @y;  # Locale-defined sort order
23           }
24           @x = sort @y;      # Native-platform/Unicode code point sort order
25                              # again
26

DESCRIPTION

28       This pragma tells the compiler to enable (or disable) the use of POSIX
29       locales for built-in operations (for example, LC_CTYPE for regular
30       expressions, LC_COLLATE for string comparison, and LC_NUMERIC for
31       number formatting).  Each "use locale" or "no locale" affects
32       statements to the end of the enclosing BLOCK.
33
34       See perllocale for more detailed information on how Perl supports
35       locales.
36
37       On systems that don't have locales, this pragma will cause your
38       operations to behave as if in the "C" locale; attempts to change the
39       locale will fail.
40
41
42
43perl v5.36.0                      2022-08-30                       locale(3pm)
Impressum