Created
August 22, 2012 20:35
-
-
Save sycobuny/3429104 to your computer and use it in GitHub Desktop.
A not-very-Perl-y way of looping
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env perl | |
use v5.14; | |
use warnings; | |
use perl5i::2; | |
[0 .. 5]->foreach(func($i) { | |
say "current value of i is $i" | |
}); | |
say 'done!' | |
__END__ | |
$ perl perl5i.pl | |
current value of i is 0 | |
current value of i is 1 | |
current value of i is 2 | |
current value of i is 3 | |
current value of i is 4 | |
current value of i is 5 | |
done! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment