Skip to content

Instantly share code, notes, and snippets.

@sycobuny
Created August 22, 2012 20:35
Show Gist options
  • Save sycobuny/3429104 to your computer and use it in GitHub Desktop.
Save sycobuny/3429104 to your computer and use it in GitHub Desktop.
A not-very-Perl-y way of looping
#!/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