Books by DeepText

Andrew Shitov

Migrating to Perl 6


This book is a guide of how to switch from Perl 5 to Perl 6. It demonstrates how the various language elements look like in Perl 5 and Perl 6. It is assumed that the reader is familiar with Perl 5 and is willing to use that knowledge base to start programming in Perl 6. If you wish, you may also learn Perl 5 using this book.

Preorder your paper copy
Worldwide delivery

Will be shipped in 2018

20+ copies? Contact us at mail@deeptext.media for discounts!


Andrew Shitov.
Migrating to Perl 6.
An Easy Transition from Perl 5

Programming languages series
Published by DeepText
Amsterdam, November 2017
ISBN 978-90-821568-5-0
Feedback: mail@deeptext.media


Perl 6 is here. We were waiting for the language since 2000. In 2015, the first stable version of the specification was released, and now it’s the best time to start migrating from Perl 5 to Perl 6. Of course, you don’t have to rewrite all your existing codebase, but it would be an excellent opportunity to start a new project, or a part of it, or a small script in it with Perl 6.

Despite the name, Perl 6 is not just the next version of Perl 5. Perl 6 is sister language to Perl 5. There is no direct backwards compatibility, but if you are familiar with Perl 5, learning Perl 6 may be much easier.

The new language is so big that it seems impossible to learn all the details of it over a weekend. But Perl 6 keeps the Perl’s spirit and allows the programmers to start with using only the basic elements, gradually injecting elements of the more complicated (and often, more powerful) areas when they are becoming comfortable with them.

In this book, we will go through the main elements of the Perl language and will see how the Perl 5 constructions can be transformed to be run under Perl 6.



Contents

Below is the draft contents of the book. Here are the main areas of interest, which need attention when migrating from Perl 5 to Perl 6. The final structure of the book may still change (normally it should change to become bigger).

Chapter 1.
Running Perl
Compilers
Command-line
Loading modules
Syntax check
Looping with -n/-p
Chapter 2.
Type System
Numeric literals
String literals
Variables
Scalars
Arrays
Hashes
Chapter 3.
Flow Control
Conditional checks
Loops
Chapter 4.
Input and Output
Printing
Formatting
Working with files
Chapter 5.
Subroutines
Signatures
References
Return values
Chapter 6.
Regular Expressions
Matching
Capturing
Character classes
Unicode
Chapter 7.
Modules
Creating a module
Using a module
Libraries
Inline::Perl5
Chapter 8.
Object-Oriented Programming
Creating classes
Hiding class data
Class methods
Inheritance
Chapter 9.
Handling Errors
Try/catch
Handling error messages
Chapter 10.
Internet
Sockets
Databases
Working with web
Chapter 11.
Special variables
Compilation phases
Pseudoconstants
Input and output
Regular expressions



300
pages
500+
code examples
6.c
modern Perl 6