Get to know Perl 6

Perl 6 finally arrived a few weeks ago, carrying a load of new features without losing its free-form charm. Here's what both Perl diehards and newbies need to know

Current Job Listings

Back in the mid-1990s, I ran an ISP and built much of the code needed to operate the service in Perl. The early versions of Larry Wall’s language were powerful tools that evolved to take advantage of new programming techniques, while staying close to Wall’s concept of a programming language that mapped to the ways we think and communicate.

For many years Wall has been working on the latest version, Perl 6, which was finally released on Christmas Day 2015. Where earlier Perl releases were interpreted languages, Perl 6 is compiled, using the Rakudo compiler to run your code in a JVM. It’s a flexible response to the way platforms have evolved since the initial release of the language, using REPL (read-eval-print-loop) to try out code snippets before you use them in an application.

Like its predecessors, Perl 6 is a free-form language. You can write code any way you like; all that’s needed is a semicolon to end a statement.

Unwrap Perl 6

Perl 6 offer three distinct types of variable: scalars, arrays, and hashes. Each is defined by a prefix to a name, and once they're defined, you can quickly apply appropriate operators to the variable.

For example, you can change the case of a string, count the number of characters, or even reverse their direction in no time at all. The ability to work quickly with string content was always one of Perl’s great strengths (in some circles it was known as “the universal string munging tool”), and it’s good to see that approach continues in the latest version. Similar operators simplify working with integers and rational numbers.

To continue reading this article register now