Config...nyThing(3pm)
π Config::Model::AnyThing β the manual, but make it make sense β¨
okay bestie, so this is Config::Model::AnyThing, and it lives in the 3pm section of the perl manual (that's the "perl modules" section, iykyk). It's a base class, which is giving foundation, blueprint, main character but in a supporting role energy. Let's get into it π
β¨ NAME β¨
Config::Model::AnyThing β the base class for a configuration tree item. That's it, that's the whole vibe.
πΈ VERSION πΈ
version 2.166 π
π¦ SYNOPSIS π¦
# internal class
yep. that's the whole synopsis. it's an internal class, so it's not out here doing public-facing slay. it's behind the scenes. the stage crew. the iconic supporting cast. no cap.
π DESCRIPTION π
Okay so here's the tea: this class must be inherited by all nodes or leaves of the configuration tree. Every single one. No exceptions, babe. π«Ά
AnyThing provides some methods and no constructor. like, it has the skills but it refuses to build itself. it's giving "i don't start, i just elevate." periodt.
π Introspection methods π
these are the "who am i, where am i, what is my purpose" methods. very self-aware. very therapy-coded. we love a class that does the work π
element_nameβ returns the element name that contain this object.index_valueβ for an object stored in an array or hash element, returns the index (or the key) that contains this object.parentβ returns the node containing this object. may returnundefifparentis called on the root of the tree (because root has no parent, it's the mother of the house π).containerβ a bit likeparent, this method returns the element containing this object. seecontainer_type.container_typeβ returns the type (e.g.listorhashorleafornodeorwarped_node) of the element containing this object.rootβ returns the root node of the configuration tree. the origin. the source. the vibes β¨locationβ returns the node location in the configuration tree. this location conforms with the syntax defined by thegrabmethod.location_shortβ returns the node location in the configuration tree. this location truncates long indexes to be readable. it cannot be used by thegrabmethod. so pretty, but not usable for grabbing. tragic, honestly πcomposite_nameβ return the element name with its index (if any). i.e. returnsfoo:barorfoo.composite_name_shortβ return the element name with its index (if any). too long indexes are truncated to be readable. β¨
π Annotation π
Annotation is a way to store miscellaneous information associated to each node. (yeah... comments. it's comments. we're calling them annotations now π )
Reading and writing annotation makes sense only if they can be read from and written to the configuration file, hence the need for the following method:
backend_support_annotationβ returns1if at least one of the backends attached to a parent node support to read and write annotations (aka comments) in the configuration file.support_annotationβ returns1if at least one of the backends support to read and write annotations (aka comments) in the configuration file.annotationβ parameters:( [ note1, [ note2 , ... ] ] )- with no argument, return a string containing the object's annotation (or an empty string).
- with several arguments, join the arguments with
"\n", store the annotations and return the resulting string. β¨
clear_annotationβ clear the annotation of an element. yes queen, let it go, start fresh π§
π’ Information management π’
okay this section is the group chat of the class. it's all about telling people stuff changed and dumping data. very communicative. very "let me update you bestie" energy π₯
notify_changeβ notify the instance of semantic changes. the parameters are:oldβ old value. (optional)newβ new value. (optional)pathβ location of the changed parameter starting from the root node. defaults to$self->location.nameβ element name. defaults to$self->element_name.indexβ if the changed parameter is part of a hash or an array,indexcontains the key or the index to get the changed parameter.noteβ information about the change. mandatory when neitheroldornewvalue are defined. like, you have to say something, babe, silence is not an option here π€reallyβ when set to1, force recording of change even if in initial load phase.needs_saveβ internal parameter.
show_messageβ parameters:( string ). forwarded toshow_messagein Config::Model::Instance.root_pathβ forwarded toroot_pathin Config::Model::Instance.model_searcherβ returns an object dedicated to search an element in the configuration model. this method returns aConfig::Model::SearchElementobject. see Config::Model::Searcher for details on how to handle a search. πdump_as_dataβ dumps the configuration data of the node and its siblings into a perl data structure. returns a hash ref containing the data. see Config::Model::DumpAsData for details. πΎwarp_errorβ returns a string describing any issue with theConfig::Model::Warperobject. returns''if invoked on a tree object without warp specification. empty string = no drama = blessed β¨
π AUTHOR π
Dominique Dumont, (ddumont at cpan dot org)
π SEE ALSO π
- Config::Model
- Config::Model::Instance
- Config::Model::Node
- Config::Model::Loader
- Config::Model::Dumper
go read those too, they're the rest of the friend group π
π AUTHOR (again, yes really) π
Dominique Dumont
π COPYRIGHT AND LICENSE π
This software is Copyright (c) 2005-2022 by Dominique Dumont.
This is free software, licensed under:
The GNU Lesser General Public License, Version 2.1, February 1999
okay that's the whole page bestie, you're so smart for reading all of it, mwah π«Ά
and that's a wrap on the perl v5.42.3, dated 2026-07-23, Config...nyThing(3pm) page β go forth and configure things, icon πβ¨π
π¦ where this page comes from
- ubuntu stonking: libconfig-model-perl 2.166-1 Β· LGPL-2.1-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms