locale - perldoc.perl.org

Perl Programming Documentation
Download Perl
Explore

Manual

- Overview
- Tutorials
- FAQs
- History / Changes
- License

Reference

- Language
- Functions
- Operators
- Special Variables
- Pragmas
- Utilities
- Internals
- Platform Specific

Modules

- A • B • C • D • E
- F • G • H • I • L
- M • N • O • P • S
- T • U • X

Tools

- Preferences

# locale

Perl 5 version 22.0 documentation
Go to top
Show page index • Show recent pages
Recently read

# locale

- NAME
- SYNOPSIS
- DESCRIPTION

# NAME

locale - Perl pragma to use or avoid POSIX locales for built-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

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.

Page index

- NAME
- SYNOPSIS
- DESCRIPTION