Rex::He...amLookup(3)
π Rex::Helper::Rexfile::ParamLookup β the manual page, but make it make sense
okay so bestie, you're reading the <pink>User Contributed Perl Documentation</pink> page for Rex::He...amLookup(3) (yes the title is squished, that's just how the man page grind works, we move) β¨
πΈ NAME πΈ
Rex::Helper::Rexfile::ParamLookup β it's literally a command for managing task parameters π
Like, that's the whole gig: it handles task parameters. And also β main character bonus feature β it registers those parameters as template values, so your templates can vibe with them too. π
Oh and it doesn't stop at task params either: this module also peeks inside a CMDB (if one is present) looking for a valid key. iykyk π₯
π¦ SYNOPSIS π¦
task "setup", sub {
my $var = param_lookup "param_name", "default_value";
};
that's it. that's the look. no cap π
β¨ LOOKUP β¨
okay so here's the order of operations, bestie, listen up π
First, param_lookup checks the task parameters for a valid parameter. Simple, iconic.
If nothing turns up there, and if a CMDB is being used, it'll go looking inside the cmdb. π΅οΈββοΈ
and here's the fun part β the namespacing behaviour, ngl this is lowkey the whole point:
If your module is named "Rex::NTP", then it will first look to see whether the key "Rex::NTP::param_name" exists. If that one doesn't exist, then it checks for the key "param_name". π«Ά
so the module-scoped key gets first dibs, and the plain un-namespaced key is the fallback. that's the vibe check. β
π§ sign-off π§
this page is from perl v5.42.3, dated 2023-08-05 β go off, queen ππ thanks for reading, now go pass your params π
π¦ where this page comes from
- nixos 26.05: perl5.42.3-Rex 1.14.3
- nixpkgs unstable: perl5.42.3-Rex 1.14.3
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms