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 return undef if parent is called on the root of the tree (because root has no parent, it's the mother of the house πŸ‘‘).
  • container β€” a bit like parent, this method returns the element containing this object. see container_type.
  • container_type β€” returns the type (e.g. list or hash or leaf or node or warped_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 the grab method.
  • location_short β€” returns the node location in the configuration tree. this location truncates long indexes to be readable. it cannot be used by the grab method. so pretty, but not usable for grabbing. tragic, honestly 😭
  • composite_name β€” return the element name with its index (if any). i.e. returns foo:bar or foo.
  • 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 β€” returns 1 if 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 β€” returns 1 if 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, index contains the key or the index to get the changed parameter.
    • note β€” information about the change. mandatory when neither old or new value are defined. like, you have to say something, babe, silence is not an option here 😀
    • really β€” when set to 1, force recording of change even if in initial load phase.
    • needs_save β€” internal parameter.
  • show_message β€” parameters: ( string ). forwarded to show_message in Config::Model::Instance.
  • root_path β€” forwarded to root_path in Config::Model::Instance.
  • model_searcher β€” returns an object dedicated to search an element in the configuration model. this method returns a Config::Model::SearchElement object. 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 the Config::Model::Warper object. 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


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