Catman...d::with(3pm)

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

🌸 Catmandu::Fix::Bind::with 🌸

ok so bestie, welcome to Catmandu::Fix::Bind::with from the User Contributed Perl Documentation πŸ’– β€” it's a binder that computes Fix-es in the context of a path. yes, that's the whole vibe. let's get into it 🫢


✨ NAME ✨

Catmandu::Fix::Bind::with β€” a binder that computes Fix-es in the context of a path. she's giving scope, she's giving context, she's literally the main character of your nested data πŸ’…


πŸ¦‹ SYNOPSIS πŸ¦‹

ok so picture this. here's your input data:

     # Input data
     data:
     - name: patrick
     - name: nicolas

and here's the Fix, no cap:

    # Fix
    do with(path:data)
        if all_match(name,nicolas)
            reject()
        end
    end

and boom, this is what you get:

    # will produce
    data:
     - name: patrick

patrick stays, nicolas said bye πŸ‘‹ and honestly? that's the whole point. slay ✨


πŸ’œ DESCRIPTION πŸ’œ

so the "with" bind lets you run fixes in the scope of a path. it's like giving your fixes their own little room to exist in, and everything inside only sees that room πŸŽ€

say you've got a deep nested data structure that looks like this:

   my:
     deep:
       field:
          name: James Brown

then these two fixes are equal β€” like, same energy, same result, fr fr:

   add_field(my.deep.field.style, funk)

   do with(path:my.deep.field)
       add_field(style,funk)
   end

see what she did there? instead of writing out the whole long path every single time, you just do with(path:my.deep.field) and then everything inside is relative to that. lowkey genius, highkey iconic πŸ‘‘


🌈 CONFIGURATION 🌈

πŸ“ path

The path to a list in the data.

that's it. that's the whole config. simple, clean, does exactly what it says on the tin πŸ’–


πŸ‘€ SEE ALSO πŸ‘€

  • Catmandu::Fix::Bind β€” go read this one too bestie, it's the whole family 🧚

and that's the page!! this was perl v5.40.1, dated 2026-01-24, from the User Contributed Perl Documentation β€” tysm for reading, mwah, go fix some data πŸ’…βœ¨

πŸ“¦ where this page comes from