Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!sdd.hp.com!spool.mu.edu!uunet!mcsun!inesc!eagle!jmc From: jmc@eagle.inesc.pt (Miguel Casteleiro) Newsgroups: comp.lang.perl Subject: sort (was Re: Help with split, replace and number formats.) Message-ID: <1991Jan31.022859.49@eagle.inesc.pt> Date: 31 Jan 91 02:31:41 GMT References: <1991Jan29.171228.17738@convex.com> <1991Jan30.181924.47@eagle.inesc.pt> <1991Jan30.195436.8645@agate.berkeley.edu> Sender: news@inesc.UUCP Organization: INESC/P1714, Lisboa, Portugal Lines: 46 Nntp-Posting-Host: eagle In article <1991Jan30.195436.8645@agate.berkeley.edu> raymond@math.berkeley.edu (Raymond Chen) writes: , jmc@eagle (Miguel Casteleiro) writes: <>[T]he sorting order will be (at least for the portuguese): <> <>a A B b c d e f ... <> <>If there is an easy way to do this, please let me know. < <# This is a standard trick. < <# You only need to do this part once. <$portuguese_order = "aABbcdef"; This won't work for me as it will simply redefine a new ascii order. What I need is a sort that will "see" 'a', 'A' and 'B' with the same sorting value if the words are different (not counting this characters), and will "see" 'a' < 'A' < 'B' when the words are equal (again, not counting this characters). <$ascii_order = < pack("c" . length($portuguese_order), 1 .. length($portuguese_order));