Course of Raku / Advanced / Testing and documentation 🆕 / Documenting code 🆕 / Exercises

A Pod section

Problem

$=pod lets a program walk into its own documentation. Write a =begin pod=end pod block containing a top-level heading and a paragraph. Then reach into the first Pod block with $=pod[0] and print how many pieces of content it holds — the heading and the paragraph count as two.

Example

The program prints:

2

Solution

See the solution

Course navigation

Solution: Formatted text   |   Solution: A Pod section