These are quite easy to implement yourself, as long as you restrict yourself to simple arrays and not complicated structures:
my $equal = ! scalar grep { $_ ne $array1[0] } @array1;
Of course, there is a minor niggle regarding the border case of an empty array - is the empty array uniform or not?
If you want to handle more complex structures than plain scalars, you have to answer the question whether all elements need to have the same structure and the same values, or whether all elements need to be the same reference. If it's the same reference, you can just use the above case, if not, you need to look at is_deeply in Test::More for example, or dump both structures with Data::Dumper and do a string compare.
Updated: neversaint spotted a typo
In reply to Re: Testing the Uniformity of an Array by its Elements
by Corion
in thread Testing the Uniformity of an Array by its Elements
by neversaint
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |