diff options
author | Gurusamy Sarathy <gsar@cpan.org> | 2000-03-22 20:04:01 +0000 |
---|---|---|
committer | Gurusamy Sarathy <gsar@cpan.org> | 2000-03-22 20:04:01 +0000 |
commit | 96f2dc66fad1b386f43884f515103adf2c3eaf29 (patch) | |
tree | eabced26f35985b97b604c13291b8cf20c5b0176 /pod/perlsyn.pod | |
parent | 1001cf6c744fd6c12445113daebc45fc715459fd (diff) | |
download | perl-96f2dc66fad1b386f43884f515103adf2c3eaf29.tar.gz |
perlsyn.pod nit (from Tom Christiansen)
p4raw-id: //depot/perl@5891
Diffstat (limited to 'pod/perlsyn.pod')
-rw-r--r-- | pod/perlsyn.pod | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/pod/perlsyn.pod b/pod/perlsyn.pod index 484af52121..724ba12ac0 100644 --- a/pod/perlsyn.pod +++ b/pod/perlsyn.pod @@ -324,7 +324,7 @@ Examples: for (@ary) { s/foo/bar/ } - foreach my $elem (@elements) { + for my $elem (@elements) { $elem *= 2; } @@ -353,8 +353,8 @@ Here's how a C programmer might code up a particular algorithm in Perl: Whereas here's how a Perl programmer more comfortable with the idiom might do it: - OUTER: foreach my $wid (@ary1) { - INNER: foreach my $jet (@ary2) { + OUTER: for my $wid (@ary1) { + INNER: for my $jet (@ary2) { next OUTER if $wid > $jet; $wid += $jet; } @@ -525,7 +525,7 @@ The C<goto>-EXPR form expects a label name, whose scope will be resolved dynamically. This allows for computed C<goto>s per FORTRAN, but isn't necessarily recommended if you're optimizing for maintainability: - goto ("FOO", "BAR", "GLARCH")[$i]; + goto(("FOO", "BAR", "GLARCH")[$i]); The C<goto>-&NAME form is highly magical, and substitutes a call to the named subroutine for the currently running subroutine. This is used by |