Catman...emplate(3pm)

πŸ“¦
version 0.14 Β· 3 versions
, in ubuntu noble, ubuntu resolute, ubuntu stonking

πŸ’– NAME πŸ’–

Catman...emplate(3pm) β€” bestie, this is Catmandu::Fix::template, and it does exactly one iconic thing: it adds a value to the record based on a template. That's it. That's the whole gig. And it ate. πŸ’…


✨ SYNOPSIS ✨

Okay so imagine your record is looking like this, right:

# Your record contains:
#
#  name: John
#  age: 44

Then you hit it with this:

template(message,"Mr [%name%] is [%age%] years old")

And boom πŸ’₯ the result is:

# Result:
#
#  name: John
#  age: 44
#  message: Mr John is 44  years old

Not me adding a whole new field with one line of Fix... the message key literally materialises out of the template, pulling name and age straight out of the record. Main character energy, fr fr. πŸ¦‹

Lowkey important: notice there are two spaces in Mr John is 44 years old β€” the template keeps every character exactly as you typed it. No cap. πŸ‘‘

🌸 SEE ALSO 🌸

  • Catmandu::Fix β€” the whole Fix ecosystem this little cutie lives in 🫢
  • Template β€” the template engine doing the actual heavy lifting behind the scenes ✨

And that's the vibe check, bestie. This page came to you courtesy of perl v5.36.0, dated 2022-09-27 β€” from the User Contributed Perl Documentation corner of the internet, with love. Go template something gorgeous. πŸ’–πŸŽ€πŸ§šβ€β™€οΈ

πŸ“¦ where this page comes from