7.2.37 I18N::Collate - Compare 8-bit Scalar Data According to the Current Localeuse I18N::Collate; setlocale(LC_COLLATE, $locale); # uses POSIX::setlocale $s1 = new I18N::Collate "
This module provides you with objects that can be collated (ordered)
according to your national character set, provided that Perl's POSIX
module and the POSIX
setlocale
(3) and
strxfrm
(3) functions are
available on your system. Here is an example of collation within the standard `C' locale: use I18N::Collate; setlocale(LC_COLLATE, 'C'); $s1 = new I18N::Collate "Hello"; $s2 = new I18N::Collate "Goodbye"; # following line prints "Hello comes before Goodbye" print "$$s1 comes before $$s2" if $s2 le $s1;
The objects returned by the < <= > >= == != <=> lt le gt ge eq ne cmp
I18N::Collate uses To determine which locales are available with your operating system, check whether the command: locale -a lists them. You can also check the locale (5) or nlsinfo manpages, or look at the filenames within one of these directories (or their subdirectories): /usr/lib/nls , /usr/share/lib/locale , or /etc/locale . Not all locales your vendor supports are necessarily installed. Please consult your operating system's documentation and possibly your local system administrator. |
|