in reply to Sort problem

Depending on what your data can contain, you could do something like that:
{ local $" = $;; @out = sort {"@$a" cmp "@$b"} @in; }
which uses the value of the subscript separator for multiple hashes, by default "\034" which occurs rather seldom in normal text. However this doens't work if your data can contain anything.

-- Hofmator