Pegex::Input(3pm)

Pegex::Input3pm

Pegex parser input abstraction

Usage

    use Pegex;
    use Pegex::Input;
    my $ast = pegex($foo_grammar)->parse(Pegex::Input->new(string => $foo_input));

Overview

Pegex::Parser parses input. The input can be a string, a string reference, a file path, or an open file handle. Pegex::Input is an abstraction over any type of input. It provides a uniform interface to the parser.

Usage

You call new() with two arguments, where the first argument is the input type:

    Pegex::Input->new(file => 'file.txt')

The following input types are available:

string

Input is a string.

stringref

Input is a string reference. This may be desirable for really long strings.

file

Input is a file path name to be opened and read.

handle

Input is from a opened file handle, to be read.

Releases

7 releases since Debian 8 (Jessie); the text changed 5 times.

  1. 8
  2. 9
  3. 10
  4. 11
  5. 12–13
  6. Arch

Author

Ingy döt Net <[email protected]>

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