This chapter will prepare you to write Perl 6 code. Before we examine variables, data types, object orientation, and other important topics, let's learn more about how the source code is organized in Perl 6. There are many elements that differ from other programming languages, and it is worth spending time getting used to it.
In this chapter, we will cover the following topics:
- Using Unicode
- Whitespaces and unspaces
- Comments
- Creating Pod documentation
- Phasers
- Simple input and output
Comments
In Chapter 1, What is Perl 6?, we've seen two ways of writing programs—by passing it in the -e command-line option or by saving it in a file. Of course, all big programs are stored in files. In this section, we will see how Perl 6 helps the programmer to organize the code better by adding comments.
Comments are parts of the source code, which are ignored by the compiler. Comments are intended to give additional information about the program itself. Good examples of comments are explanations of the algorithms used, or the purpose of variables, or a description of the input arguments of a function.
Perl 6 offers two ways of saving additional human-oriented information in the source code by using comments and the so-called Pod. First, we will examine the comments.
Comments are fragments of source code that a compiler does not consider as direct instructions for...