diff options
author | Sean Nam <namsangwoo1@gmail.com> | 2017-02-09 17:11:10 -0800 |
---|---|---|
committer | Sean Nam <namsangwoo1@gmail.com> | 2017-02-09 17:11:10 -0800 |
commit | 13663f3726c39639b23615b9f963ca4b30650408 (patch) | |
tree | 9b0977479e908ab0d3c4fbcb3b9cc471a557beb0 /perl.html.markdown | |
parent | 5254804c1ccf51fb3c3c500a7095dd8408371837 (diff) | |
parent | 45de0120d641cfaac0bb60b25a24782ec106e719 (diff) |
Merge branch 'master' of github.com:adambard/learnxinyminutes-docs
Pulling from master to work on Java[en] inputs
Diffstat (limited to 'perl.html.markdown')
-rw-r--r-- | perl.html.markdown | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/perl.html.markdown b/perl.html.markdown index a29fdf1f..93eabea9 100644 --- a/perl.html.markdown +++ b/perl.html.markdown @@ -138,18 +138,16 @@ while (condition) { # for loops and iteration -for (my $i = 0; $i < $max; $i++) { +for my $i (0 .. $max) { print "index is $i"; } -for (my $i = 0; $i < @elements; $i++) { - print "Current element is " . $elements[$i]; -} - for my $element (@elements) { print $element; } +map {print} @elements; + # implicitly for (@elements) { |