- all BLOCK LIST
-
Evaluates the BLOCK for each element of the LIST (locally setting
$_to each element) and checks the truth of the result of that block. Returns true if every element makes the block yield true, or returns false if at least one element makes the block false.LIST の各要素に対して BLOCK を評価し(各要素はローカルに
$_に設定されます)、ブロックの真偽をチェックします。 全ての要素がブロックの結果を真にした場合に真になり、 少なくとも一つの要素がブロックの結果を偽にした場合に偽になります。As soon as any element makes the block yield false, then the result of this operator is determined. It will short-circuit in that case and not consider any further elements.
どれかの要素がブロックの結果を偽にした時点で、この演算子の結果は 決定されます。 この場合短絡評価され、残りの要素は考慮されません。
When used as a condition, this is similar to using grep to count that every value satisfies the condition, except for this short-circuit behaviour.
条件として使うと、これは次の短絡評価の振る舞いを除いて、 条件を満たす値の数を数える grep を 使うのと似ています。
if( all { length $_ } @strings ) { say "Every string is non-empty"; }is roughly equivalent to
これはおおまかに次と等価です:
if( @strings == grep { length $_ } @strings ) ...This operator is only available if the
keyword_allfeature is enabled.この演算子は、
keyword_all機能 が 有効の場合にのみ利用可能です。It is currently considered experimental, and will issue a compile-time warning in the category
experimental::allunless that category is silenced.これは現在のところ 実験的 と考えられており、
experimental::allカテゴリの 警告を抑制しない限り、このカテゴリのコンパイル時警告が発生します。