Rex::H...mLookup(3pm)

πŸŽ€ NAME πŸŽ€

Rex::Helper::Rexfile::ParamLookup β€” bestie, this is the little command that manages your task parameters. πŸ’…

Not only that, but it also registers those parameters as template values, so they're just… there for you, ready to vibe in your templates. ✨

And plot twist: this module will also peek inside a CMDB (if one exists, like, if you have one) to hunt down a valid key. πŸ•΅οΈβ€β™€οΈ No cap.


🌸 SYNOPSIS 🌸

task "setup", sub {
  my $var = param_lookup "param_name", "default_value";
};

Look at her go. Iconic. πŸ’–


πŸ¦‹ LOOKUP πŸ¦‹

Okay so here's the tea on how the lookup actually goes down, fr fr:

  • First, param_lookup checks the task parameters for a valid parameter. That's step one, always.
  • If none is found, and if a CMDB is being used, it will look inside the cmdb. πŸ‘€

And here's the part that's lowkey genius β€” the naming order, okay, stay with me:

If your module is named "Rex::NTP", then it will first look to see if the key "Rex::NTP::param_name" exists. 🌈

If it doesn't exist, then it checks for the key "param_name". πŸ’«

So it's giving module-namespaced-first, plain-name-as-fallback. Main character energy from a lookup function, honestly. πŸ‘‘


tl;dr: task params β†’ CMDB (if present), and when it hits the CMDB it tries "Your::Module::param_name" before it ever slums it with plain "param_name". 🫢

That's the whole page, bestie β€” she's short but she's mighty. πŸ’œ

This one's from perl v5.40.1, dated 2025-10-03, and yeah β€” it's Rex::H...mLookup(3pm), filed under User Contributed Perl Documentation. Stan a tiny helper module. βœ¨πŸ’–πŸ¦‹

πŸ“¦ where this page comes from