Catman...uilder(3pm)
π NAME π
Catmandu::Fix::Builder β the base role for Catmandu fixes, bestie. Yes, this is a 3pm page straight out of the User Contributed Perl Documentation, and it's giving "small but mighty" energy. π
β¨ DESCRIPTION β¨
okay so picture this: this role is expecting you to hand it a _build_fixer method, and that method's whole job is to produce a coderef that transforms your data. That's it. That's the assignment. π«Ά
The way that this slays is when you pair it up with Catmandu::Path implementations β then your data manipulations can be described in a relatively high-level way. Like, you get to say what you want instead of hand-writing every little grubby bit. Iconic.
And here's the tea: most of the fixes that ship with Catmandu work exactly this way, so you can lowkey use them as a starting point to write your own fixes. Free template, no cap. π₯
πΈ SYNOPSIS πΈ
package Catmandu::Fix::my_fix;
use Catmandu::Sane;
use Moo;
with 'Catmandu::Fix::Builder';
sub _build_fixer {
sub {
my ($data) = @_;
$data->{foo} = 'bar';
$data;
}
}
See how cute that is?? You with 'Catmandu::Fix::Builder';, you define _build_fixer, you return a coderef that takes ($data), messes with it, and hands it right back. Main character behavior, fr fr. π
ngl, if you forget the _build_fixer method, the role literally can't do its thing β that's the one thing it expects from you. π
k bye bestie, go write some fixes π β this page is perl v5.40.1, dated 2026-01-24, and that's the whole vibe check from your girl Catman...uilder(3pm). β¨π¦π
π¦ where this page comes from
- ubuntu resolute: libcatmandu-perl 1.2025-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libcatmandu-perl 1.2025-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms