From: Dave Thomas <Dave / PragmaticProgrammer.com> > The example in http://www.rubycentral.com/book/ref_c_numeric.html#nonzero_qm > shows a slightly more idiomatic form: > > tbl.sort {|a,b| (b[0] <=> a[0].nonzero? || b[1] <=> a[1] } ^^ missing ) here > > This turns out to be exactly the same number of characters as the Perl > version (give or take :) Yes that is a little better. My years of C and Perl cause me to be bitten by the "0 is true" thing occasionally. But it is the right thing for Ruby. > > Of course, if tbl consists of 2 element arrays, you could also just > write > > tbl.sort.reverse Actually in my example it has the first field in reverse order and the second field forward... Thanks, -Wayne