This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
undo change#5506; add patch to make blank line warnings optional
[perl5.git] / lib / locale.pm
CommitLineData
bbce6d69 1package locale;
2
3=head1 NAME
4
5locale - Perl pragma to use and avoid POSIX locales for built-in operations
6
7=head1 SYNOPSIS
8
9 @x = sort @y; # ASCII sorting order
10 {
11 use locale;
12 @x = sort @y; # Locale-defined sorting order
13 }
14 @x = sort @y; # ASCII sorting order again
15
16=head1 DESCRIPTION
17
18This pragma tells the compiler to enable (or disable) the use of POSIX
19locales for built-in operations (LC_CTYPE for regular expressions, and
20LC_COLLATE for string comparison). Each "use locale" or "no locale"
21affects statements to the end of the enclosing BLOCK.
22
b8bc843f
A
23See L<perllocale> for more detailed information on how Perl supports
24locales.
25
bbce6d69 26=cut
27
d5448623
GS
28$locale::hint_bits = 0x800;
29
bbce6d69 30sub import {
d5448623 31 $^H |= $locale::hint_bits;
bbce6d69 32}
33
34sub unimport {
d5448623 35 $^H &= ~$locale::hint_bits;
bbce6d69 36}
37
381;