@@ -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,69 @@ 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<any_all> feature|feature/"The 'any_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::any_all> unless that category is
839
+ silenced.
840
+
841
+ =item any BLOCK LIST
842
+
843
+ =for Pod::Functions test if at least one value in a list satisfies the given condition
844
+
845
+ Evaluates the BLOCK for each element of the LIST (locally setting
846
+ L<C<$_>|perlvar/$_> to each element) and checks the truth of the result of
847
+ that block. Returns true if at least one element makes the block yield
848
+ true, or returns false if no element is found to make it true.
849
+
850
+ As soon as any element makes the block yield true, then the result of this
851
+ operator is determined. It will short-circuit in that case and not consider
852
+ any further elements.
853
+
854
+ When used as a condition, this is similar to L<C<grep>|/grep BLOCK LIST>,
855
+ except for this short-circuit behaviour.
856
+
857
+ if( any { length $_ } @strings ) {
858
+ say "At least one string is non-empty";
859
+ }
860
+
861
+ is roughly equivalent to
862
+
863
+ if( grep { length $_ } @strings ) ...
864
+
865
+ This operator is only available if the
866
+ L<C<any_all> feature|feature/"The 'any_all' feature"> is enabled.
867
+
868
+ It is currently considered B<experimental>, and will issue a compile-time
869
+ warning in the category C<experimental::any_all> unless that category is
870
+ silenced.
871
+
808
872
=item atan2 Y,X
809
873
X<atan2> X<arctangent> X<tan> X<tangent>
810
874
0 commit comments