Iterating lists
Use for to iterate over things that provide iterators
Each item is passed to the block
my @suits = <Clubs Diamonds Hearts Spades>; for @suits { say $_; }
Can also use as a statement modifier
say $_ for @suits;
Perl 6 | Perl 6 today | #22 |
Use for to iterate over things that provide iterators
Each item is passed to the block
my @suits = <Clubs Diamonds Hearts Spades>; for @suits { say $_; }
Can also use as a statement modifier
say $_ for @suits;
Copyright © 2009 http://www.pmichaud.com/2009/pres/ |