Config...escribe(3pm)

πŸ’… Config::Model::Describe β€” the whole "wait, what's actually IN this config node?" moment

okay bestie, so this page is from the User Contributed Perl Documentation manual, section 3pm, and it's literally called Config...escribe(3pm) (yes the header truncates it, it's Config::Model::Describe, the terminal just ran out of room, tragic). ✨


🌸 NAME 🌸

Config::Model::Describe β€” giving you an actual human-readable description of a node element. no cap.

πŸŽ€ VERSION πŸŽ€

version 2.166 β€” she's been around, she's seasoned, she's iconic.

πŸ¦‹ SYNOPSIS πŸ¦‹

here's the whole lil' vibe, verbatim, don't touch a character:

use Config::Model;

# define configuration tree object
my $model = Config::Model->new;
 $model->create_config_class(
   name    => "Foo",
   element => [
       [qw/foo bar/] => {
           type       => 'leaf',
           value_type => 'string'
       },
   ]
);
 $model ->create_config_class (
   name => "MyClass",

   element => [

       [qw/foo bar/] => {
           type       => 'leaf',
           value_type => 'string'
       },
       hash_of_nodes => {
           type       => 'hash',     # hash id
           index_type => 'string',
           cargo      => {
               type              => 'node',
               config_class_name => 'Foo'
           },
       },
   ],
) ;

my $inst = $model->instance(root_class_name => 'MyClass' );

my $root = $inst->config_root ;

# put data
my $steps = 'foo=FOO hash_of_nodes:fr foo=bonjour -
  hash_of_nodes:en foo=hello ';
$root->load( steps => $steps );

print $root->describe ;

### prints
# name          type       value          comment
# foo           string     FOO
# bar           string     [undef]
# hash_of_nodes node hash  <Foo>          keys: "en" "fr"

like. look at that output. she described it. πŸ’…

πŸ’– DESCRIPTION πŸ’–

So Config::Model::Node uses this module directly to describe a node element. Basically this module hands you back a string a human can actually read, showing you what's inside a configuration node. it's giving "peer review but for your config tree."

For instance (the way the "fstab" example shows it):

name         type         value        comment
fs_spec      string       [undef]      mandatory
fs_vfstype   enum         [undef]      choice: auto davfs ext2 ext3 swap proc iso9660 vfat ignore, mandatory
fs_file      string       [undef]      mandatory
fs_freq      boolean      0
fs_passno    integer      0

obsessed honestly. πŸ”₯

This module also gets used by the "ll" command of Config::Model::TermUI. iykyk.


🧚 CONSTRUCTOR 🧚

✨ new ✨

No parameters. literally none. and the constructor should be used only by Config::Model::Node β€” so don't come in here thinking you can just call it yourself, bestie. this is a behind-the-scenes girlie. πŸ™ˆ

⭐ Methods ⭐

🌈 describe 🌈

Returns a description string. that's the whole job. 🫢

The parameters are:

  • node β€” A reference to a Config::Model::Node object. Mandatory. she's required, no skipping. πŸ‘‘
  • element β€” Only describe this element from the node. Optional! If you leave it out, all elements get described.
  • pattern β€” Describe the element that matches the regexp ref. Example:
describe => ( pattern => qr/^foo/ )
  • hide_empty β€” Boolean. Do you wanna hide empty values (i.e. "undef" or '') or not? Default is false. so by default, the empty ones are visible, lowercase b, periodt. πŸ’€
  • verbose β€” Boolean. Shows more info for each element. Default is false. turn it on when you want the full lore. ✨

πŸ’œ AUTHOR πŸ’œ

Dominique Dumont, (ddumont at cpan dot org) 🫢

🌸 SEE ALSO 🌸

Config::Model, Config::Model::Node, Config::Model::ObjTreeScanner β€” go read those next, bestie, they're the whole friend group.

πŸ’œ AUTHOR πŸ’œ

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

and that's the whole page, babe πŸ’– this was built for perl v5.42.3 and this particular page is dated 2026-07-23 β€” so yeah, timestamped, versioned, licensed, slayed. go describe some nodes. 🌟

πŸ“¦ where this page comes from