in reply to Re^2: So what is an array slice anyway?
in thread So what is an array slice anyway?

Here's an idiomatic way to test whether the contents of two arrays are equal — assuming the elements are numbers, anyway.

print "equal\n" if @array1 == @array2 and !grep $array1[ $_ ] != $array2[ $_ ], 0 .. $#array1;

In scalar context, grep evaluates to the number of elements it returned, so that condition says "if both arrays have the same length, and if no elements are found which are not equal".

Makeshifts last the longest.