Catman...:assoc(3pm)

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

✨ NAME ✨

Catman...:assoc β€” it's a Catmandu::Fix thingy that takes two values and glues them together as a hash key and its value πŸ’– (manual name's Catman...:assoc(3pm), if you're keeping receipts, and it lives in the User Contributed Perl Documentation fam).


πŸŽ€ SYNOPSIS πŸŽ€

okay so here's the whole vibe, bestie β€” you feed it a bunch of pairs, and it turns each key + val duo into an actual hash entry πŸ¦‹

# {pairs => [{key => 'year', val => 2009}, {key => 'subject', val => 'Perl'}]}
assoc(fields, pairs.*.key, pairs.*.val)
# {fields => {subject => 'Perl', year => 2009}, pairs => [...]}}

like?? it just works ✨ the pairs array stays exactly where it is, but now you've also got a shiny fields hash with subject and year all cozy inside it πŸ’…


πŸ‘‘ SEE ALSO πŸ‘‘

  • Catmandu::Fix β€” go say hi, it's the parent energy here 🫢

that's the whole page fr fr, short and iconic, no notes 🌸

signing off with love: this lil doc is from perl v5.40.1, dated 2026-01-24 β€” slay πŸ’œπŸŽ€

πŸ“¦ where this page comes from