No::Sort - Norwegian sorting


  use No::Sort;
  @sortert = no_sort @norske_ord;


This module provde the function no_sort() which sort a ISO-8859/1 encoded string according to Norwegian practice. The routine works like the normal perl sort routine, but the optional first argument is special. It can either be a reference to the strxfrm() function to use while sorting or a reference to a hash used to transform the words while sorting.

You can also import the no_xfrm() function which is used for standard sorting. It can be useful to base your custom transformation function on it. If we for instance would like to sort "Aa" as "Å" we could implement it like this:

  use No::Sort qw(no_sort no_xfrm);
  sub my_xfrm {
      my $word = shift;
      $word =~ s/A[aA]/Å/g;
      $word =~ s/aa/å/g;
  @sorted = no_sort \&my_xfrm, @names;

By the way, the my_xfrm shown in this example can be imported from this module under the name 'no_aa_xfrm':

  use No::Sort qw(no_sort no_aa_xfrm);
  @sorted = no_sort \&no_aa_xfrm, @names;

If you set the $No::Sort::DEBUG variable to a TRUE value, then we will make some extra noise on STDOUT while sorting.

The module can also export functions for up/down casing ISO-8859/1 strings. These functions are called latin1_uc(), latin1_lc(), latin1_ucfirst(), latin1_lcfirst().




Hallvard B Furuseth <>, Gisle Aas <>

1 POD Error

The following errors were encountered while parsing the POD:

Around line 35:

Non-ASCII character seen before =encoding in '"Å"'. Assuming ISO8859-1