my %check; @check{@arr} = (1) x @arr; print "All the same" if keys %check == 1;