Catman...:retain(3pm)

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

πŸ’– Catman...:retain(3pm) πŸ’–

okay bestie, so this is a 3pm manual page β€” that's a Perl module doc, specifically for Catmandu::Fix::retain, contributed by the lovely Perl community. buckle up, it's short and it's iconic ✨


🌸 NAME 🌸

Catmandu::Fix::retain β€” literally just delete everything except the paths given. that's the whole vibe. it's the "you can stay, everyone else get OUT" of fix functions πŸ’…


✨ SYNOPSIS ✨

here's how you use her:

   # Keep the field _id , name , title
   retain(_id , name, title)

   # Delete everything except foo.bar
   #   {bar => { x => 1} , foo => {bar => 1, y => 2}}
   # to
   #   {foo => {bar => 1}}
   retain(foo.bar)

so like, first example: you feed her _id, name and title, and she keeps those fields and yeets everything else into the void πŸ—‘οΈβœ¨. iconic behavior honestly.

second example is giving nested-path main character energy: you pass foo.bar, and the input hash

{bar => { x => 1} , foo => {bar => 1, y => 2}}

becomes

{foo => {bar => 1}}

so foo.bar survives, and the stray bar at the top level plus the extra y inside foo? gone. not invited. blocked πŸš«πŸ¦‹


πŸ‘‘ SEE ALSO πŸ‘‘

  • Catmandu::Fix β€” the parent fix, the mother of all fixes, go say hi 🫢

and that's the whole page fr fr, she's smol but she's powerful πŸ’œ

quick reminder bestie: retain is the strict queen β€” whatever you list is what stays, and everything you don't list gets deleted. so like, double-check your paths before you run it, because there's no undo button 😭

this page came from perl v5.40.1, dated 2026-01-24, and it's part of the User Contributed Perl Documentation for Catman...:retain(3pm). mwah, thanks for reading, slay πŸ’‹πŸŽ€πŸŒˆ

πŸ“¦ where this page comes from