From: Nuralanur@... Date: 2006-03-04T00:23:29+09:00 Subject: Re: Array comparison returning nil -------------------------------1141399389 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Could it be that some of the elements in your arrays cannot be compared, like "a" and 1 ? You can help this by mapping all these elements to numbers or strings, which can be sorted, as in this example a = ["three",3, "four",4] c = ["ten",10,"eleven",11] b=a.sort{ |x,y| x.to_s <=> y.to_s}<=>c.sort { |x,y| x.to_s <=> y.to_s} puts "result is #{b}" which gives a result -1, since 3 is smaller than 10. Best regards, Axel -------------------------------1141399389--