Go to main content

man pages section 3: Library Interfaces and Headers

Exit Print View

Updated: Wednesday, July 27, 2022
 
 

locale (3)

Name

locale - in operations

Synopsis

@x = sort @y;      # Native-platform/Unicode code point sort order
{
use locale;
@x = sort @y;  # Locale-defined sort order
}
@x = sort @y;      # Native-platform/Unicode code point sort order
# again

Description

Perl Programmers Reference Guide                                     locale(3)



NAME
       locale - Perl pragma to use or avoid POSIX locales for built-in
       operations

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

SYNOPSIS
           @x = sort @y;      # Native-platform/Unicode code point sort order
           {
               use locale;
               @x = sort @y;  # Locale-defined sort order
           }
           @x = sort @y;      # Native-platform/Unicode code point sort order
                              # again

DESCRIPTION
       This pragma tells the compiler to enable (or disable) the use of POSIX
       locales for built-in operations (for example, LC_CTYPE for regular
       expressions, LC_COLLATE for string comparison, and LC_NUMERIC for
       number formatting).  Each "use locale" or "no locale" affects
       statements to the end of the enclosing BLOCK.

       See perllocale for more detailed information on how Perl supports
       locales.

       On systems that don't have locales, this pragma will cause your
       operations to behave as if in the "C" locale; attempts to change the
       locale will fail.



ATTRIBUTES
       See attributes(7) for descriptions of the following attributes:


       +---------------+-----------------------+
       |ATTRIBUTE TYPE |   ATTRIBUTE VALUE     |
       +---------------+-----------------------+
       |Availability   | runtime/perl-532      |
       +---------------+-----------------------+
       |Stability      | Pass-through volatile |
       +---------------+-----------------------+

NOTES
       Source code for open source software components in Oracle Solaris can
       be found at https://www.oracle.com/downloads/opensource/solaris-source-
       code-downloads.html.

       This software was built from source available at
       https://github.com/oracle/solaris-userland.  The original community
       source was downloaded from
       http://www.cpan.org/src/5.0/perl-5.32.0.tar.gz.

       Further information about this software can be found on the open source
       community website at https://www.perl.org/.



perl v5.32.0                      2020-06-14                         locale(3)