List::Util's all will do that.
#!/usr/bin/env perl use strict; use warnings; use List::Util 'all'; print "a yes\n" if all { $_ == 0 } (0, 0, 0); print "b no\n" unless all { $_ == 0 } (0, 1, 0);
In reply to Re: Check multiple array elements for a single condition
by hippo
in thread Check multiple array elements for a single condition
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |