Catmandu::Fix::Parser(3pm)

Catmandu::Fix::Parser3pm

The parser of the catmandu::fix language

Usage

    use Catmandu::Sane;
    use Catmandu::Fix::Parser;
    use Catmandu::Fix;
    use Data::Dumper;
    my $parser = Catmandu::Fix::Parser->new;
    my $fixes;
    try {
        $fixes = $parser->parse(<<EOF);
    add_field(test,123)
    EOF
    }
    catch {
        printf "[%s]\nscript:\n%s\nerror: %s\n"
                , ref($_)
                , $_->source
                , $_->message;
    };
    my $fixer = Catmandu::Fix->new(fixes => $fixes);
    print Dumper($fixer->fix({}));

Overview

Programmers are discouraged to use the Catmandu::Parser directly in code but use the Catmandu package that provides the same functionality:

    use Catmandu;
    my $fixer = Catmandu->fixer(<<EOF);
    add_field(test,123)
    EOF
    print Dumper($fixer->fix({}));

Methods

new()

Create a new Catmandu::Fix parser

parse($string)

Reads a string and returns a blessed object with parsed Catmandu::Fixes. Throws an Catmandu::ParseError on failure.

Releases

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

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

From libcatmandu-perl 1.2024-1 in Debian 13 (Trixie). Parsed by carta from the page's man source.