I have two arrays, @a
and @b
. I want to do a compare among the elements of the two arrays.
my @a = qw\"abc def efg ghy klm ghn\";
m
This is Perl. The 'obvious' solution:
my @a = qw"abc def efg ghy klm ghn";
my @b = qw"def ghy jgk lom com klm";
print "arrays equal\n"
if @a == @b and join("\0", @a) eq join("\0", @b);
given "\0" not being in @a.
But thanks for confirming that there is no other generic solution than rolling your own.