Subject: | Function to compare two arrays for "equallity" |
I'm getting bored of writing
@x == @y and all { $x[$_] == $y[$_] } 0 .. $#x
or
@x == @y and all { $x[$_] eq $y[$_] } 0 .. $#x
I propose a new pair of functions that
Return true if the two arrays whose references are given are the same length, and
contain the same {numbers,strings}.
I don't have a good name but maybe
equalnum \@x, \@y
equalstr \@x, \@y
We should check CPAN for existing precedent first and see if there's a good name we can reïmplement.
As a bonus feature, allow more than two arrayrefs.
--
Paul Evans