NAME

Cz::Sort - Czech sort

SYNOPSIS

use Cz::Sort;
my $result = czcmp("_x j&á", "_&p");
my @sorted = czsort qw(plachta plaòka Plánièka plánièka plánì);
print "@sorted\n";

DESCRIPTION

Implements czech sorting conventions, indepentent on current locales in effect, which are often bad. Does the four-pass sort. The idea and the base of the conversion table comes from Petr Olsak's program csr.

The basic function provided by this module, is czcmp. If compares two scalars and returns the (-1, 0, 1) result. The function can be called directly, like

my $result = czcmp("_x j&á", "_&p");

But for convenience and also because of compatibility with older versions, there is a function czsort. It works on list of strings and returns that list, hmm, sorted. The function is defined simply like

sub czsort
	{ sort { czcmp($a, $b); } @_; }

standard use of user's function in sort. Hashes would be simply sorted

@sorted = sort { czcmp($hash{$a}, $hash{$b}) }
					keys %hash;

Both czcmp and czsort are exported into caller's namespace by default, as well as cscmp and cssort that are just aliases.

This module comes with encoding table prepared for ISO-8859-2 (Latin-2) encoding. If your data come in different one, you might want to check the module Cstocs which can be used for reencoding of the list's data prior to calling czsort, or reencode this module to fit your needs.

I have built and tested this module using Perl 5.004 but it should work fine with any version 5 of Perl -- the module doesn't use any of the 5.004 specials. If you receive any errors with older (or newer) versions, please let me know and I try to fix them.

VERSION

0.66

SEE ALSO

perl(1), Cz::Cstocs(3).

AUTHOR

(c) 1997 Jan Pazdziora <adelton@fi.muni.cz>, http://www.fi.muni.cz/~adelton/

at Faculty of Informatics, Masaryk University, Brno

1 POD Error

The following errors were encountered while parsing the POD:

Around line 9:

Non-ASCII character seen before =encoding in 'j&á",'. Assuming CP1252