Catman...exists(3pm)

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

πŸ’– NAME πŸ’–

Catmandu::Fix::Condition::exists β€” bestie, this is the little fix condition that checks if a path exists, and it only runs your fixes when it does. That's it. That's the whole vibe. iconic, honestly ✨


🌸 SYNOPSIS 🌸

okay so here's the tea, fr fr β€” you wrap your fixes in an if exists(...) and they only go off when that path is actually there:

# uppercase the value of field 'foo' if the field 'oogly' exists
if exists(oogly)
  upcase(foo) # foo => 'BAR'
end
# inverted
unless exists(oogly)
  upcase(foo) # foo => 'bar'
end

and yes bestie, you can flip it with unless when you want the opposite energy πŸ’…


πŸ‘‘ SEE ALSO πŸ‘‘

  • Catmandu::Fix β€” go read this one too, it's the main character 🫢

and that's a wrap, my love 🌈 this little page came to you via perl v5.40.1, dated 2026-01-24 β€” go forth and conditionally fix things, no cap πŸ’–βœ¨

πŸ“¦ where this page comes from