We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent fb6f481 commit 376253fCopy full SHA for 376253f
lib/Language/control.pod
@@ -136,11 +136,23 @@ specify a final value for the block.
136
}
137
#-> Int
138
139
-=begin comment
140
-
141
=head2 loop
142
143
-=end comment
+The C<loop> statement is the C-style C<for> loop in disguise:
+
+ loop (my $i = 0; $i < 10; $i++) {
144
+ ...
145
+ }
146
147
+As in C, the parentheses are required if you supply the 3-part spec;
148
+however, the 3-part loop spec may be entirely omitted to write an infinite
149
+loop. That is,
150
151
+ loop {...}
152
153
+is equivalent to the C-ish idiom:
154
155
+ loop (;;) {...}
156
157
=head2 repeat/while, repeat/until
158
0 commit comments