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_lookupchecks 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
- ubuntu resolute: rex 1.16.1-1 Β· Apache-2.0
- ubuntu stonking: rex 1.16.1-1 Β· Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms