---
name: "locale"
section: "3pm"
platform: "linux"
package: "perl-5.004-doc"
version: "5.004.05-6"
release: "Debian 2.2 (Potato)"
platforms: ["linux"]
url: "https://new.carta.tech/locale/3pm"
---

# locale(3pm)

Perl pragma to use and avoid POSIX locales for built-in operations

## NAME

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

## SYNOPSIS

```
    @x = sort @y;       # ASCII sorting order
    {
        use locale;
        @x = sort @y;   # Locale-defined sorting order
    }
    @x = sort @y;       # ASCII sorting order again
```

## DESCRIPTION

This pragma tells the compiler to enable (or disable) the use of POSIX locales for built-in operations (LC\_CTYPE for regular expressions, and LC\_COLLATE for string comparison).  Each "use locale" or "no locale" affects statements to the end of the enclosing BLOCK.
