- Perl 6 Deep Dive
- Andrew Shitov
- 105字
- 2021-07-03 00:05:44
The --doc command
The --doc (notice the double hyphen) command-line extracts the documentation from the program and prints it. Here, the so-called Pod documentation is meant. We will cover the Pod syntax in Chapter 2, Writing Code.
Let's see the small program that includes the documentation inside itself:
=begin pod =head1 Hello, World program =item This program prints "Hello, World!" =end pod say "Hello, World!";
Run it with the --doc command-line option as follows:
$ perl6 --doc pod.pl
It will print only parts of the documentation. The code itself will not be executed:
Hello, World program * This program prints "Hello, World!"