Revision 14545,
798 bytes
checked in by ghudson, 24 years ago
(diff) |
This commit was generated by cvs2svn to compensate for changes in r14544,
which included commits to RCS files with non-trunk default branches.
|
Line | |
---|
1 | package locale; |
---|
2 | |
---|
3 | =head1 NAME |
---|
4 | |
---|
5 | locale - 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 | |
---|
18 | This pragma tells the compiler to enable (or disable) the use of POSIX |
---|
19 | locales for built-in operations (LC_CTYPE for regular expressions, and |
---|
20 | LC_COLLATE for string comparison). Each "use locale" or "no locale" |
---|
21 | affects statements to the end of the enclosing BLOCK. |
---|
22 | |
---|
23 | See L<perllocale> for more detailed information on how Perl supports |
---|
24 | locales. |
---|
25 | |
---|
26 | =cut |
---|
27 | |
---|
28 | $locale::hint_bits = 0x800; |
---|
29 | |
---|
30 | sub import { |
---|
31 | $^H |= $locale::hint_bits; |
---|
32 | } |
---|
33 | |
---|
34 | sub unimport { |
---|
35 | $^H &= ~$locale::hint_bits; |
---|
36 | } |
---|
37 | |
---|
38 | 1; |
---|
Note: See
TracBrowser
for help on using the repository browser.