App::C...:Config(3pm)
β¨ 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
undefif 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:coreandsiteparams can be set if they're as-yet undefined, but onlymetaparams 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
- debian bookworm: libapp-cell-perl 0.231-1 Β· BSD-3-Clause
- debian trixie: libapp-cell-perl 0.231-1 Β· BSD-3-Clause
- ubuntu noble: libapp-cell-perl 0.231-1 Β· BSD-3-Clause
- ubuntu resolute: libapp-cell-perl 0.231-1 Β· BSD-3-Clause
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms