------=_Part_45042_23178773.1164243892803
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

I want to check to see if two arrays contain the same values.
That is, are they the same array but not in the same order.

Example
equal
[1,2,3,4,"abc"] should equal [2,3,1,"abc",4]  and all the other different
orders that are possible

This should not be equal
[1,2,3] and [1,1,2,3]
[1,2,3,nil] and [nil, nil, nil, 1,2,1,3,2]

At first I thought of
(( array1 | array2 ) - array1).size == 0

but this does not take into account duplicate values and the should not
equals do equal :(.  In fact I have not been able work out how to use any of
the standard array, or Enumerable methods in such a way I can check if two
arrays contain the same values as well as taking into account duplicates.

Any pointers?

Cheers
Daniel

------=_Part_45042_23178773.1164243892803--