[sf-perl] Perl6 Study Session: Chapter 3 of Moritz Lenz
doomvox at gmail.com
Tue May 15 12:59:59 PDT 2018
For the next "Perl 6 Informal Study Session" this Sunday
The "assigned reading" is Chapter 3 of "Perl 6 Fundamentals"
by Moritz Lenz. Chapter 3 works through a simple example:
subdividing a string into fixed-width chunks and formatting
them for output.
The main pieces involved are the built-in "substr" routine
plus the Str methods "trans" and "comb" and the List method "join".
It uses the looping constructs "for" and "loop" but also the
more unusual "gather/take" feature.
Even if you don't have the Moritz Lenz book at hand,
you might just take a look at some of the perl6 docs:
The substr routine:
The trans and comb Str methods:
The join List method (which is also a stand-alone routine):
The gather block which is used with take:
The loop and for control-flow constructs:
The %% operator (checks for divisibility without a remainder):
More information about the SanFrancisco-pm