Config:...Section(3)
β¨ NAME β¨
Config::MVP::Section β one single section of an MVP configuration sequence, bestie π
πΈ VERSION πΈ
version 2.200013 β¨
π DESCRIPTION π
okay so, real talk? for the most part you can literally just go read Config::MVP and it'll tell you what this class is and how it's used. that's it, that's the vibe. this page is like the little sister page π«Ά
π PERL VERSION π
this module should work on any version of perl that's still getting updates from the Perl 5 Porters. translation? any perl released in the last two to three years, periodt. (like β if the most recently released version is v5.40, then this module should work on both v5.40 and v5.38.) π₯
and yeah, it may work on older perls, but no guarantee is made that the minimum required version won't get bumped. the version can be increased for literally any reason, and there is no promise that patches will be accepted to lower the minimum required perl. it's giving "we said what we said" π
π ATTRIBUTES π
π name
this is the section's name. it's a string, and bestie it must be provided. non-negotiable. mandatory. slay but also mandatory π
π package
this is the (Perl) package that the section is associated with. it's optional π« when the section gets instantiated, it will make sure this package is loaded. no cap.
π multivalue_args
this attribute is an arrayref of value names that should be treated as multivalue properties in the section. when they get added to the section, they'll always be wrapped in an arrayref, and they may be added to the section more than once. iconic behaviour honestly π
if this attribute isn't given during construction, it defaults to the result of calling the section's package's mvp_multivalue_args method. and if the section has no associated package, or if the package doesn't provide that method? it defaults to an empty arrayref. very "no thoughts, head empty" of it π«§
π aliases
this attribute is a hashref of name remappings. for example, if it contains this hashref:
{
file => 'files',
path => 'files',
}
then attempting to set either the "file" or "path" setting for the section would actually set the "files" setting. sneaky little redirect, we love her β¨
if this attribute isn't given during construction, it defaults to the result of calling the section's package's mvp_aliases method. if the section has no associated package, or if the package doesn't provide that method, it defaults to an empty hashref πͺ
π payload
this is the storage where properties get set. it's a hashref of names and values. you should probably not alter the contents of the payload, and you should read its contents only. hands off, babe π
π is_finalized
this attribute is true if the section has been marked finalized, which prevents any new values from being added to it. it can be set with the "finalize" method. once it's locked in, it's locked in π
π sequence
this attribute points to the sequence into which the section has been assembled. it may be unset if the section has been created but not yet placed in a sequence. baby section, no home yet π
π METHODS π
β add_value
$section->add_value( $name => $value );
this method sets the value for the named property to the given value. if the property is a multivalue property, the new value will be pushed onto the end of an arrayref that stores all the values for that property. stacking them up like a little collection π§Ί
attempting to add a value for a non-multivalue property whose value was already added will result in an exception. so like... don't do that. it will yell at you π£οΈ
β load_package
$section->load_package($package, $section_name);
this method is used to make sure the given $package is loaded, and it gets called whenever a section with a package is created. by default, it delegates to Class::Load. if the package can't be found, it calls the missing_package method. errors in compilation are not suppressed β no sweeping things under the rug here π
β missing_package
$section->missing_package($package, $section_name);
this method gets called when "load_package" runs into a package that is not installed. by default, it throws an exception. dramatic? yes. correct? also yes π
π¦ AUTHOR π¦
Ricardo Signes <cpan@semiotic.systems> π
π COPYRIGHT AND LICENSE π
this software is copyright (c) 2022 by Ricardo Signes.
this is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. π«Ά
okay and before you go β this whole thing lives in the perl v5.42.0 docs, dated 2025-07-25, and it's Config:...Section(3) under User Contributed Perl Documentation. stan a legend, read your manpages, hydrate, bye bestie ππβ¨
π¦ where this page comes from
- fedora 43: perl-Config-MVP 2.200013-9.fc43 Β· GPL-1.0-or-later OR Artistic-1.0-Perl
- fedora 44: perl-Config-MVP 2.200013-9.fc43 Β· GPL-1.0-or-later OR Artistic-1.0-Perl
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms