App::C...:Config(3pm)

πŸ“¦
version 0.231 Β· 3 versions
, in debian bookworm, debian trixie, ubuntu noble, ubuntu resolute

✨ App::CELL::Config ✨

okay so bestie, welcome to App::CELL::Config πŸ’– β€” this is the Perl module that loads, stores, and dispenses meta parameters, core parameters, and site parameters. it's giving config queen. periodt.


🌸 SYNOPSIS 🌸

use App::CELL::Config qw( $meta $core $site );

# get a parameter value (returns value or undef)
my $value;
$value = $meta->MY_PARAM;
$value = $core->MY_PARAM;
$value = $site->MY_PARAM;

# set a meta parameter
$meta->set( 'MY_PARAM', 42 );

# set an as-yet undefined core/site parameter
$core->set( 'MY_PARAM', 42 );
$site->set( 'MY_PARAM', 42 );

πŸ¦‹ DESCRIPTION πŸ¦‹

so the whole purpose of this module, like its entire main character energy, is to maintain and provide access to three package variables: $meta, $core, and $site. and plot twist β€” those aren't just lil variables, they're actually singleton objects πŸ’… holding configuration parameters that get loaded by App::CELL::Load from files in the distro sharedir and the site configuration directory, if any even exists.

for the details, read App::CELL::Guilde. (yes, that's how it's spelled, i don't make the rules 🫢)


πŸŽ€ EXPORTS πŸŽ€

this module exports three scalars: the 'singleton' objects $meta, $core, and $site. that's it. that's the whole drop. iconic.


πŸ‘‘ SUBROUTINES πŸ‘‘

🌟 AUTOLOAD

the "AUTOLOAD" routine handles calls that look like this:

$meta->MY_PARAM
$core->MY_PARAM
$site->MY_PARAM

so yeah, you just call the param name like a method and AUTOLOAD catches it. no cap.

πŸ’€ DESTROY

for some reason, Perl 5.012 seems to want a DESTROY method. so. here it is. we provide it. we don't ask questions πŸ™ˆ

🌈 exists

determine parameter existence. that's the vibe check β€” does this param exist or not?

πŸ“ get

wrapper for get_param.

πŸ’œ get_param

get value of config param provided in the argument.

🧚 get_param_metadata

routine to provide access not only to the value, but also to the metadata (the file and line number where the parameter was defined) associated with a given parameter. receipts, basically. we know where it came from ✨

  • Takes: parameter name.
  • Returns: reference to the hash associated with the given parameter, or undef if no parameter found.

⭐ set

use this function to set new params (meta/core/site) or change existing ones (meta only). takes two arguments: parameter name and new value. returns a status object.

ok so read that again bestie: core and site params can be set if they're as-yet undefined, but only meta params can be changed once they exist. don't come for me, that's just the rule πŸ’…

this has been App::CELL::Config, perl v5.34.0, dated 2022-07-17, from the User Contributed Perl Documentation. bye bestie, go configure something cute πŸŽ€πŸ’–πŸ¦‹

πŸ“¦ where this page comes from