Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!usc!elroy.jpl.nasa.gov!jpl-devvax!lwall From: lwall@jpl-devvax.jpl.nasa.gov (Larry Wall) Newsgroups: comp.lang.perl Subject: Re: Is Perl's sort stable? Keywords: sort, perl Message-ID: <1991Apr9.044100.22563@jpl-devvax.jpl.nasa.gov> Date: 9 Apr 91 04:41:00 GMT References: <1991Apr3.224701.9318@eng.umd.edu> Reply-To: lwall@jpl-devvax.JPL.NASA.GOV (Larry Wall) Organization: Jet Propulsion Laboratory, Pasadena, CA Lines: 12 In article <1991Apr3.224701.9318@eng.umd.edu> stripes@eng.umd.edu (Joshua Osborne) writes: : Is Perl's sort stable? By that I mean if I have a list of 6 char long scalers, : and ask sort to sort by the last 3 letters and then again by the first 3 will : I have the same effect as if I had sorted by all six in the same place? (I am : asking because I have data sorted by date given in a messy date format, and : I want to sort by user name but preserve the secondary sorting by date... I : could solve the problem without assuming Perl's sort is stable, but why go to : all that extra work if Perl does do a stable sort?). No, it relies on C's qsort, which is not stable. Sorry... Larry