in reply to Sort problem

As long as you know that there won't be embedded null characters, you can do this:
{ local $" = "\0"; @out = sort {"@$a" cmp "@$b" } @in; }

Replies are listed 'Best First'.
Re: Sort problem
by Abigail-II (Bishop) on Feb 26, 2003 at 22:15 UTC
    You and previous poster are almost there. But instead of setting $" to a byte that's not expected to be present, set it to the empty string:
    { local $" = ""; @out = sort {"@$a" cmp "@$b"} @in; }

    You can combine that with a GRT or an ST.

    Abigail