in reply to Compare all array values without a loop
"If the number of elements equal to $foobar is the same as the number of elements in the array..." orif (grep({ $_ eq $foobar } @array) == @array) { ... }
"Unless you find an element that is not equal to foobar..." Of course, these are both loops of a kind.unless (grep { $_ ne $foobar} @array) { ... }
rjbs
In Section
Seekers of Perl Wisdom