Pegex::Tutorial(3pm)

Pegex::Tutorial3pm

Pegex Tutorials

Pegex has a growing number of tutorials on how to do various parsing tasks.

This document is just an index to the current tutorials.

Pegex::Tutorial::JSON

This is a very in-depth tutorial of the creation of the module Pegex::JSON (a JSON decoder that uses Pegex) and the thought that went into creating it. It covers almost all of the Pegex::Syntax as well.

Pegex::Tutorial::Calculator

Pegex comes with an "eg/" directory. One example is "eg/calculator/calculator1.pl" in Pegex. It's a simple precedence parser (and evaluator) for arithmetic expressions like this one:

    1 * (2 + 3) / (4 ^ 5 ^ 6 - -7)

From perl-pegex 0.75-8 in Arch Linux 2026-11-01. Parsed by carta from the page's man source.