Catman...:rename(3pm)

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

✨ NAME ✨

Catmandu::Fix::rename β€” the fix that renames your fields with a regex πŸ’…

Okay bestie, so this is Catman...:rename(3pm) from the User Contributed Perl Documentation, and it's giving glow-up for your field names. Lowkey iconic.


πŸŽ€ SYNOPSIS πŸŽ€

Like, here's the vibe. You feed it a field, a regex to match, and what to swap it for:

# dotted => {'ns.foo' => 'val', list => {'ns.bar' => 'val'}}
rename(dotted, '\.', '-')
# dotted => {'ns-foo' => 'val', list => {'ns-bar' => 'val'}}

So before, your field was all 'ns.foo' and 'ns.bar' (dotted, periodt πŸ’€), and after running the fix it's 'ns-foo' and 'ns-bar' β€” the dots got swapped for dashes, no cap. The way that regex just does that? Obsessed. πŸ¦‹


🌸 SEE ALSO 🌸

  • Catmandu::Fix β€” go read it, bestie, it's the whole family 🫢

And that's the whole page, fr fr. This gem is part of the Perl v5.40.1 docs, dated 2026-01-24 β€” so go forth, rename those fields, and slay βœ¨πŸ‘‘πŸ’–

πŸ“¦ where this page comes from