Catman...x::uniq(3pm)

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

✨ NAME ✨

okay bestie, welcome to Catmandu::Fix::uniq πŸ’– β€” it's a Catmandu::Fix page from the User Contributed Perl Documentation, section 3pm, and it does exactly one thing and does it flawlessly:

  • Catmandu::Fix::uniq β€” strip duplicate values from an array 🧹✨

like… that's it. that's the whole job. it takes your array, it looks at all the lil values, and it goes "not today, twin" to every repeat. iconic behaviour honestly πŸŽ€


🌸 SYNOPSIS 🌸

here's the whole vibe in one little block, no cap πŸ¦‹

# {tags => ["foo", "bar", "bar", "foo"]}
uniq(tags)
# {tags => ["foo", "bar"]}

so you walk in with tags being ["foo", "bar", "bar", "foo"] β€” kinda messy, kinda giving "i said it twice bc i meant it" 😭 β€” and you walk out with ["foo", "bar"]. the duplicates got un-alived (affectionately), the survivors kept their order, and the array is now clean. slay. πŸ’…

lowkey the way this works is you call uniq(tags) on the field name and it rewrites that same field in place, so your fix file stays cute and tidy. periodt.

πŸ‘‘ SEE ALSO πŸ‘‘

go touch grass in these other pages when you're done here, bestie 🌈

  • Catmandu::Fix β€” the whole Fix framework this lil cutie lives inside 🫢

and that's the tea β˜•βœ¨ this page ships as part of perl v5.40.1, dated 2026-01-24, and it belongs to the Catmandu::Fix::uniq manual (section 3pm) β€” mwah, go dedupe something gorgeous πŸ’–πŸŽ€πŸ¦‹

πŸ“¦ where this page comes from