1*0Sstevel@tonic-gatepackage locale; 2*0Sstevel@tonic-gate 3*0Sstevel@tonic-gateour $VERSION = '1.00'; 4*0Sstevel@tonic-gate 5*0Sstevel@tonic-gate=head1 NAME 6*0Sstevel@tonic-gate 7*0Sstevel@tonic-gatelocale - Perl pragma to use and avoid POSIX locales for built-in operations 8*0Sstevel@tonic-gate 9*0Sstevel@tonic-gate=head1 SYNOPSIS 10*0Sstevel@tonic-gate 11*0Sstevel@tonic-gate @x = sort @y; # ASCII sorting order 12*0Sstevel@tonic-gate { 13*0Sstevel@tonic-gate use locale; 14*0Sstevel@tonic-gate @x = sort @y; # Locale-defined sorting order 15*0Sstevel@tonic-gate } 16*0Sstevel@tonic-gate @x = sort @y; # ASCII sorting order again 17*0Sstevel@tonic-gate 18*0Sstevel@tonic-gate=head1 DESCRIPTION 19*0Sstevel@tonic-gate 20*0Sstevel@tonic-gateThis pragma tells the compiler to enable (or disable) the use of POSIX 21*0Sstevel@tonic-gatelocales for built-in operations (LC_CTYPE for regular expressions, and 22*0Sstevel@tonic-gateLC_COLLATE for string comparison). Each "use locale" or "no locale" 23*0Sstevel@tonic-gateaffects statements to the end of the enclosing BLOCK. 24*0Sstevel@tonic-gate 25*0Sstevel@tonic-gateSee L<perllocale> for more detailed information on how Perl supports 26*0Sstevel@tonic-gatelocales. 27*0Sstevel@tonic-gate 28*0Sstevel@tonic-gate=cut 29*0Sstevel@tonic-gate 30*0Sstevel@tonic-gate$locale::hint_bits = 0x4; 31*0Sstevel@tonic-gate 32*0Sstevel@tonic-gatesub import { 33*0Sstevel@tonic-gate $^H |= $locale::hint_bits; 34*0Sstevel@tonic-gate} 35*0Sstevel@tonic-gate 36*0Sstevel@tonic-gatesub unimport { 37*0Sstevel@tonic-gate $^H &= ~$locale::hint_bits; 38*0Sstevel@tonic-gate} 39*0Sstevel@tonic-gate 40*0Sstevel@tonic-gate1; 41