in reply to Re: All array elements the same?
in thread All array elements the same?

You don't usually need the (1) x @arr when doing stuff like this. This would suffice perfectly:
@check{@array_to_test} = (); # Sets them all to undef $all_the_same = (keys %check <= 1); # empty @ary = true too? heck, wh +y not?
If you were checking a true/false condition based on the presence of any of the keys, the 1 would be needed, but all we're interested in here is the keys.