none#
True if the block returns true for no element (including empty list).
Synopsis#
my $bool = none { BLOCK } @list;
if ( none { $_ < 0 } @measurements ) { ... }
For each element none sets $_ to that element and calls the
block in scalar context. It returns false as soon as the block
returns true for any element. An empty list yields true.
What you get back#
1 if every element failed the block, 0 otherwise.
Examples#
die "negatives present" unless none { $_ < 0 } @measurements;
my $clean = none { /ERROR/ } @log_lines;
my $none = none { 1 } (); # 1 — nothing to fail
Differences from upstream#
Fully compatible with upstream.
See also#
any— inverse: at least one match.all— require every element to match.notall— at least one failure.