A Perl function. Logically the negation of any
. Returns a true value if no item in LIST meets the criterion given through BLOCK.Sets $_
for each item in LIST in turn:
print "No non-negative values" if none { $_ >= 0 } ($x, $y, $z);
Thus, none_u(@list)
is equivalent to @list ? none(@list) : undef
.For an empty LIST, none
returns true (i.e. no values failed the condition) and none_u
returns undef
.
Note: because Perl treats undef
as false, you must check the return value of none_u
with defined
or you will get the opposite result of what you expect.
Comments
0 comments
Please sign in to leave a comment.