Catman...:Parser(3pm)

πŸ“¦
version 1.2025 Β· 4 versions
, in ubuntu resolute, ubuntu stonking

πŸ’– Catman...:Parser(3pm) πŸ’–

okay bestie, so this is a page from the User Contributed Perl Documentation, and it's all about Catmandu::Fix::Parser β€” literally the parser of the Catmandu::Fix language. she's the one who reads your fix scripts and turns them into something real. no cap. πŸŽ€


✨ NAME ✨

Catmandu::Fix::Parser β€” the parser of the Catmandu::Fix language. that's it, that's the whole job description, and she eats every time. πŸ’…


🌸 SYNOPSIS 🌸

here's the vibe in code form, copy it exactly bestie:

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({}));

see how she catches her own errors and prints ref($_), $_->source and $_->message? that's the drama and the diagnostics all in one. iconic. πŸ‘‘


πŸ¦‹ DESCRIPTION πŸ¦‹

okay so, real talk: programmers are discouraged from using Catmandu::Parser directly in their code πŸ™ˆ. instead, use the Catmandu package, because it gives you the exact same functionality with way less chaos:

use Catmandu;

my $fixer = Catmandu->fixer(<<EOF);
add_field(test,123)
EOF

print Dumper($fixer->fix({}));

same energy, fewer moving parts. the way that she just works. ✨


πŸ’… METHODS πŸ’…

new()

Create a new Catmandu::Fix parser. brand new, fresh out the box, ready to parse. 🫢

parse($string)

Reads a string and returns a blessed object with parsed Catmandu::Fixes. slay.

⚠️ on failure she throws an Catmandu::ParseError. so wrap her in a try/catch unless you enjoy surprises, bestie. 😭

🌈 SEE ALSO 🌈

  • Catmandu::Fix πŸ’œ

Or consult the webpages below for more information on the Catmandu::Fix language:

go read them, iykyk. πŸ“


and that's the whole page, no notes. this was perl v5.40.1, dated 2026-01-24, and it's giving main character energy from the Catman...:Parser(3pm) files. mwah, love u, go parse something gorgeous. πŸ’–βœ¨πŸŽ€

πŸ“¦ where this page comes from