Search icon
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Perl 6 Deep Dive

You're reading from  Perl 6 Deep Dive

Product type Book
Published in Sep 2017
Publisher Packt
ISBN-13 9781787282049
Pages 402 pages
Edition 1st Edition
Languages
Author (1):
Andrew Shitov Andrew Shitov
Profile icon Andrew Shitov

Table of Contents (15) Chapters

1. What is Perl 6? 2. Writing Code 3. Working with Variables and Built-in Data Types 4. Working with Operators 5. Control Flow 6. Subroutines 7. Modules 8. Object-Oriented Programming 9. Input and Output 10. Working with Exceptions 11. Regexes 12. Grammars 13. Concurrent Programming 14. Functional Programming 15. Reactive Programming

Perl 6 resources

Perl 6 has a long history and many documents were created during that time, for instance, language ideas, draft specifications, and compiler documentation. Many enthusiasts wrote articles and blog posts about Perl 6. Some of that is outdated and does not reflect the current state of the language. In this chapter, I will give you a brief list of materials that are up-to-date and that you should use in your practice of working with Perl 6.

Documentation

The main entry point for documentation of the Perl 6 programming language is the Documentation section of Perl 6's site (http://docs.perl6.org). It contains a few sections with a comprehensive description of the types, operators, and built-in classes that are available in Perl 6. As the language is still developing, you may sometimes find places in the documentation where it does not reflect the current state of the language. In this case, you may consult the community of language developers or check the files from the test suite.

Test Suite

Perl 6's test suite, called Roast, can be found in the repository at https://github.com/perl6/roast. It contains thousands of tests covering many corners of Perl 6. The test suite is also a good place to look if you want to see ways you can write programs in Perl 6. It may be a long read sometimes, but many tests are checking the features from all possible angles.

In Roast, the tests are grouped in directories with names such as S32-io. These names correspond to the numbers of the Synopses, and are split into thematic sections. For example, for the Synopses 11 'Compilation Units', there exist three directories in testsS11-compunits, S11-modules, and S11-repository.

STD.pm

STD.pm is a huge file describing the formal Perl 6 grammar. The grammar of Perl 6 is written in Perl 6 itself. The repository of https://github.com/perl6/std contains the grammar and the viv utility that translates the grammar into the Perl 5 code. We have mentioned the STD.pm grammar because it may be interesting for those readers who want to dig deeper into the internal structure of the grammar. In the rest of this book, we will explain the grammar based on examples of code in Perl 6.

Community

The developers of Perl 6 traditionally use IRC for communication. You may also join the #perl6 channel to ask questions about the language or execute a piece of Perl 6 online.

To join the channel, follow the instructions listed on the https://perl6.org/community/ page.

If you want to run the code in IRC, refer to the rakudo bot as follows:

<me> rakudo: say "Hello, World!"
<+camelia> rakudo-moar cb8fa0: OUTPUT: «Hello, World!␤»

In the output, you can see that Rakudo is using the MoarVM backend by default. The string that was printed by the program is displayed after the OUTPUT keyword.

Use this feature carefully as the result of your requests will be visible to the whole room and also be logged. The best use case is to show the behavior of the compiler when you find a bug or when you see a different result from what is said in the documentation. The Perl 6 developers are always present in the IRC channel and will advise on what is wrong or will aim to fix the bug and make the documentation correct.

If you are on Facebook, visit the Perl 6 group here:
https://www.facebook.com/groups/1595443877388632/

In the offline, you will see many people who love Perl 6 at various conferences. Go to the Perl Conference (previously known as YAPC, (Yet Another Perl Conference)), which is held every year in Europe and in the USA. You may find more about them on http://theperlconference.org and http://www.yapc.eu. For many years, there were work Perl booths at the big open-source conferences like OSCON and FOSDEM. There are also many local conferences, workshops, and local group meetings. Find the closest group to your location at http://pm.org.

Next Chapter arrow right
You have been reading a chapter from
Perl 6 Deep Dive
Published in: Sep 2017 Publisher: Packt ISBN-13: 9781787282049
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime}