Excel:...itional(3pm)

πŸ“¦
version 0.34 Β· 2 versions
  • 0.34 Β· debian bookworm, debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking (latest)
  • 0.34 Β· ubuntu jammy
, in debian bookworm, debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking

✨ NAME ✨

Excel::Template::Container::Conditional β€” bestie, that's the whole name, that's the whole vibe πŸ’–

This page lives in the User Contributed Perl Documentation, section 3pm (iykyk, that's where the Perl module manpages hang out πŸŽ€).


🌸 PURPOSE 🌸

It gives you conditional execution of children nodes. Like, the kids only run if the vibe check passes. πŸ¦‹


πŸ‘‘ NODE NAME πŸ‘‘

IF


🧚 INHERITANCE 🧚

CONTAINER


πŸ’… ATTRIBUTES πŸ’…

  • NAME β€” this is the name of the parameter you're testing. It gets resolved like literally any other parameter name would be. (q.v. VAR for more info, go look it up bestie πŸ‘€)
  • VALUE β€” if VALUE is set, then a comparison operation happens. The value of NAME gets compared to VALUE using whatever OP is. πŸ“
  • OP β€” if VALUE is set, then this is checked. If it's not present, then '==' (numeric equality) is just assumed, no biggie. OP has to be one of Perl's numeric comparison operators or the string comparison operators. All 6 of each kind is supported. ✨
⚠️ Note: if you wanna use < or <=, you have to use &lt; or &lt;= instead. This is to make sure it will parse with XML::Parser. You should not need to use &gt; or &gt;= instead of > and >=, respectively. Not me warning you about XML entity drama 😭
  • IS β€” if VALUE is not set, then IS gets checked. IS is allowed to be either "TRUE" or "FALSE". The boolean value of NAME is checked against IS. Periodt. πŸ’œ

🫢 CHILDREN 🫢

None β€” it's giving childless, and honestly? iconic. πŸ™ˆ


🌈 EFFECTS 🌈

None πŸ’€


⭐ DEPENDENCIES ⭐

None πŸ‘‘


πŸŽ€ USAGE πŸŽ€

<if name="__ODD__" is="false">
  ... Children here
</if>

So in the above example, the children will be executed if the value of __ODD__ (which is set by the LOOP node, ty bestie) is false. Which means: for all even iterations. Every single even one. Slay. πŸ”₯


πŸ’– AUTHOR πŸ’–

Rob Kinyon (rob.kinyon@gmail.com)


🌸 SEE ALSO 🌸

LOOP, VAR β€” go read those too, they're lowkey essential πŸ¦‹


and that's the whole page bestie!! this one was perl v5.34.0, dated 2022-06-13, and it's out here living as Excel:...itional(3pm) πŸŽ€ mwah, go forth and conditionally execute πŸ’…βœ¨

πŸ“¦ where this page comes from