Catman...uilder(3pm)

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

πŸ’– 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