This HTML version of Think Perl 6 is provided for convenience, but it is not the best format of the book. You might prefer to read the PDF version.
Think Perl 6: How to Think Like a Computer Scientist
Laurent Rosenfeld, with Allen B. Downey
1st Edition, Version 0.5.0
This book has been divided in two parts. The main reason for that is that I wanted to make a distinction between on the one hand relatively basic notions that are really needed for any programmer using Perl 6, and on the other hand more advanced concepts that a good programmer needs to know but may be less often needed in the day-to-day development work.
The first eleven chapters (a bit more than 200 pages) which make up this first part are meant to teach the concepts that every programmer should know: variables, expressions, statements, functions, conditionals, recursion, operator precedence, loops, etc., as well as the basic data structures commonly used, and the most useful algorithms. These chapters can, I believe, be the basis for a one-semester introductory course on programming.
Of course, the professor or teacher that wishes to use this material is entirely free to skip some details from this Part 1 (and also to include sections from Part 2), but, at least, I have provided some guidelines on how I think this book could be used to teach programming using the Perl 6 language.
The second part focuses on different programming paradigms and more advanced programming techniques that are in my opinion of paramount importance, but should probably studied in the context of a second, more advanced, semester.
For now, let’s get down to the basics. It is my hope that you will enjoy the trip.
Now that you have reached the end of the first part of this book, you should non longer be a pure beginner. By now, you should be able to go through the official Perl 6 documentation (https://docs.perl6.org) and find your way.
There are many more things to say about programming. The next three chapters will be devoted to more advanced concepts and new programming paradigms, including:
Each of these chapters probably deserves a full book in its own right (and might have one some day), but we hope to tell you enough about them to get you going. In my opinion, every programmer should know about these powerful concepts in order to be able to select the best way to solve a given problem.
Perl 6 is a multiparadigm language, so we can really cover these topics in terms of the Perl 6 language. A number of subjects that we have introduced in previous chapters should lead you easily into these new ideas, and this is the reason why I think it is possible to properly cover them with just one chapter for each of these subjects.
There will be far fewer exercises in the second part, because we expect you by now to be able to think up your own exercises and make your own experiments for yourself. And there will be only very few suggested solutions, because we are getting at a level where there is really not one right solution, but many possible ways to tackle a problem.
Concerning the Perl language, we have covered a lot of material, but, as I warned from the very beginning, this is far from exhaustive. The following are among the topics that we have not covered (and will not cover); you might want to explore the documentation on them yourself:
Are you using one of our books in a class?We'd like to know about it. Please consider filling out this short survey.
This document was translated from LATEX by HEVEA.