{
    "mode": "man",
    "parameter": "locale",
    "section": "3",
    "url": "https://www.chedong.com/phpMan.php/man/locale/3/json",
    "generated": "2026-06-07T16:09:49Z",
    "synopsis": "@x = sort @y;      # Native-platform/Unicode code point sort order\n{\nuse locale;\n@x = sort @y;  # Locale-defined sort order\n}\n@x = sort @y;      # Native-platform/Unicode code point sort order\n# again",
    "sections": {
        "NAME": {
            "content": "locale - Perl pragma to use or avoid POSIX locales for built-in operations\n",
            "subsections": []
        },
        "WARNING": {
            "content": "DO NOT USE this pragma in scripts that have multiple threads active.  The locale is not local\nto a single thread.  Another thread may change the locale at any time, which could cause at a\nminimum that a given thread is operating in a locale it isn't expecting to be in.  On some\nplatforms, segfaults can also occur.  The locale change need not be explicit; some operations\ncause perl to change the locale itself.  You are vulnerable simply by having done a \"use\nlocale\".\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "@x = sort @y;      # Native-platform/Unicode code point sort order\n{\nuse locale;\n@x = sort @y;  # Locale-defined sort order\n}\n@x = sort @y;      # Native-platform/Unicode code point sort order\n# again\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "This pragma tells the compiler to enable (or disable) the use of POSIX locales for built-in\noperations (for example, LCCTYPE for regular expressions, LCCOLLATE for string comparison,\nand LCNUMERIC for number formatting).  Each \"use locale\" or \"no locale\" affects statements\nto the end of the enclosing BLOCK.\n\nSee perllocale for more detailed information on how Perl supports locales.\n\nOn systems that don't have locales, this pragma will cause your operations to behave as if in\nthe \"C\" locale; attempts to change the locale will fail.\n\n\n\nperl v5.34.0                                 2025-07-25                                locale(3perl)",
            "subsections": []
        }
    },
    "summary": "locale - Perl pragma to use or avoid POSIX locales for built-in operations",
    "flags": [],
    "examples": [],
    "see_also": []
}