官术网_书友最值得收藏!

  • 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!"
主站蜘蛛池模板: 镇安县| 龙游县| 尤溪县| 苍南县| 惠水县| 临高县| 全南县| 康乐县| 平阴县| 双桥区| 肥乡县| 金堂县| 平塘县| 青龙| 汝阳县| 稻城县| 大化| 湖北省| 区。| 元阳县| 浮梁县| 桐梓县| 正安县| 秭归县| 新余市| 淄博市| 南京市| 沈阳市| 盘山县| 绥芬河市| 通化县| 交城县| 阿图什市| 沧源| 长寿区| 繁昌县| 深州市| 彰化市| 双峰县| 沅江市| 闻喜县|