diff options
author | Chip Salzenberg <chip@pobox.com> | 1997-09-16 09:47:28 -0400 |
---|---|---|
committer | Gurusamy Sarathy <gsar@cpan.org> | 1998-03-02 03:01:27 +0000 |
commit | ecca16b0cfe0c7f04ba520f2924946a13507530e (patch) | |
tree | 24ae5b5a1830dddf285dc713d84023901e907fd8 /pod | |
parent | dab48698179b4e8606409875b7121f225bcf46be (diff) | |
download | perl-ecca16b0cfe0c7f04ba520f2924946a13507530e.tar.gz |
[win32] yet another patch
Message-Id: <199709161748.NAA08418@nielsenmedia.com>
Subject: Tiny but massively cool: C<statement foreach @list>
p4raw-id: //depot/win32/perl@612
Diffstat (limited to 'pod')
-rw-r--r-- | pod/perlsyn.pod | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/pod/perlsyn.pod b/pod/perlsyn.pod index 5274d28383..205be7d97a 100644 --- a/pod/perlsyn.pod +++ b/pod/perlsyn.pod @@ -79,14 +79,16 @@ modifiers are: unless EXPR while EXPR until EXPR + foreach EXPR The C<if> and C<unless> modifiers have the expected semantics, -presuming you're a speaker of English. The C<while> and C<until> -modifiers also have the usual "while loop" semantics (conditional -evaluated first), except when applied to a do-BLOCK (or to the -now-deprecated do-SUBROUTINE statement), in which case the block -executes once before the conditional is evaluated. This is so that you -can write loops like: +presuming you're a speaker of English. The C<foreach> modifier is an +iterator: For each value in EXPR, it aliases $_ to the value and +executes the statement. The C<while> and C<until> modifiers have the +usual "while loop" semantics (conditional evaluated first), except +when applied to a do-BLOCK (or to the now-deprecated do-SUBROUTINE +statement), in which case the block executes once before the +conditional is evaluated. This is so that you can write loops like: do { $line = <STDIN>; |