@@ -173,6 +173,7 @@ X<list>
173
173
174
174
=for Pod::Functions =LIST
175
175
176
+ L<C<all>|/all BLOCK LIST>, L<C<any>|/any BLOCK LIST>,
176
177
L<C<grep>|/grep BLOCK LIST>, L<C<join>|/join EXPR,LIST>,
177
178
L<C<map>|/map BLOCK LIST>, L<C<qwE<sol>E<sol>>|/qwE<sol>STRINGE<sol>>,
178
179
L<C<reverse>|/reverse LIST>, L<C<sort>|/sort SUBNAME LIST>,
@@ -805,6 +806,67 @@ For more information see L<perlipc>.
805
806
806
807
Portability issues: L<perlport/alarm>.
807
808
809
+ =item all BLOCK LIST
810
+
811
+ =for Pod::Functions test if every value in a list satisfies the given condition
812
+
813
+ Evaluates the BLOCK for each element of the LIST (locally setting
814
+ L<C<$_>|perlvar/$_> to each element) and checks the truth of the result of
815
+ that block. Returns true if every element makes the block yield true, or
816
+ returns false if at least one element makes the block false.
817
+
818
+ As soon as any element makes the block yield false, then the result of this
819
+ operator is determined. It will short-circuit in that case and not consider
820
+ any further elements.
821
+
822
+ When used as a condition, this is similar to using L<C<grep>|/grep BLOCK LIST>
823
+ to count that every value satisfies the condition, except for this
824
+ short-circuit behaviour.
825
+
826
+ if( all { length $_ } @strings ) {
827
+ say "Every string is non-empty";
828
+ }
829
+
830
+ is roughly equivalent to
831
+
832
+ if( @strings == grep { length $_ } @strings ) ...
833
+
834
+ This operator is only available if the
835
+ L<C<all> feature|feature/"The 'all' feature"> is enabled.
836
+
837
+ It is currently considered B<experimental>, and will issue a compile-time
838
+ warning in the category C<experimental::all> unless that category is silenced.
839
+
840
+ =item any BLOCK LIST
841
+
842
+ =for Pod::Functions test if at least one value in a list satisfies the given condition
843
+
844
+ Evaluates the BLOCK for each element of the LIST (locally setting
845
+ L<C<$_>|perlvar/$_> to each element) and checks the truth of the result of
846
+ that block. Returns true if at least one element makes the block yield
847
+ true, or returns false if no element is found to make it true.
848
+
849
+ As soon as any element makes the block yield true, then the result of this
850
+ operator is determined. It will short-circuit in that case and not consider
851
+ any further elements.
852
+
853
+ When used as a condition, this is similar to L<C<grep>|/grep BLOCK LIST>,
854
+ except for this short-circuit behaviour.
855
+
856
+ if( any { length $_ } @strings ) {
857
+ say "At least one string is non-empty";
858
+ }
859
+
860
+ is roughly equivalent to
861
+
862
+ if( grep { length $_ } @strings ) ...
863
+
864
+ This operator is only available if the
865
+ L<C<any> feature|feature/"The 'any' feature"> is enabled.
866
+
867
+ It is currently considered B<experimental>, and will issue a compile-time
868
+ warning in the category C<experimental::any> unless that category is silenced.
869
+
808
870
=item atan2 Y,X
809
871
X<atan2> X<arctangent> X<tan> X<tangent>
810
872
0 commit comments