[sf-perl] Perl6 Study Session: Chapter 3 of Moritz Lenz

Joseph Brenner doomvox at gmail.com
Tue May 15 12:59:59 PDT 2018


For the next "Perl 6 Informal Study Session" this Sunday

  https://www.meetup.com/San-Francisco-Perl/events/250589080/

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:
  https://docs.perl6.org/type/Str#routine_substr

The trans and comb Str methods:
  https://docs.perl6.org/type/Str#method_trans
  https://docs.perl6.org/type/Str#routine_comb

The join List method (which is also a stand-alone routine):
  https://docs.perl6.org/type/List#routine_join

The gather block which is used with take:
  https://docs.perl6.org/language/control#gather/take

The loop and for control-flow constructs:
  https://docs.perl6.org/language/control#index-entry-control_flow__loop-loop
  https://docs.perl6.org/language/control#for

The %% operator (checks for divisibility without a remainder):
  https://docs.perl6.org/language/operators#infix_%%


More information about the SanFrancisco-pm mailing list