Config...earcher(3pm)

πŸ¦‹ Config::Model::TreeSearcher β€” the perl manpage, bestie edition

okay so this is a User Contributed Perl Documentation page for Config::Model::TreeSearcher, a lil Perl module that lives in section 3pm. it's the one you want when you're like "where in this giant config tree did I put that word??" πŸ’…


✨ NAME ✨

Config::Model::TreeSearcher β€” search tree for match in value, description...


🌸 VERSION 🌸

version 2.166 β€” yeah she's been through some things, she's thriving tho πŸ’–


πŸŽ€ SYNOPSIS πŸŽ€

here's the whole vibe, verbatim, no edits because code is sacred:

 use Config::Model ;

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

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

 my $root = $inst->config_root ;

 my $steps = 'baz:fr=bonjour baz:hr="dobar dan" foo="journalled"';
 $root->load( steps => $steps ) ;

 my @result = $root->tree_searcher(type => 'value')->search('jour');
 print join("\n",@result),"\n" ;
 # print
 #  baz:fr
 #  foo

so you load some stuff into your tree, then you search 'jour' and it comes back with baz:fr and foo because both of those contain "jour" somewhere in a value. she ate and left no crumbs πŸ”₯


πŸ’œ DESCRIPTION πŸ’œ

this class gives you a way to search the content of a configuration tree. you hand it a keyword or a pattern, and the search method scans the tree to find a value, a description, or literally anything that matches your pattern (or keyword). it's giving detective energy πŸ”βœ¨

🫢 Constructor

new (type => [ value | description ... ] )

creates a brand new searcher object, slay. the "type" parameter can be:

  • element
  • value
  • key
  • summary
  • description
  • help
  • all β€” this one searches in all the items above πŸ‘‘ the whole menu, no skips

πŸ’… Methods

parameters: (keyword)

searches for that keyword or pattern inside the tree. the search is done in a case insensitive manner (so Jour, JOUR, jour β€” all the same, no drama πŸ¦‹).

it returns a list of paths pointing to the matching tree elements. for the deets on the path syntax, go look at "grab" in Config::Model::Role::Grab. 😌


πŸ’€ BUGS πŸ’€

creating a class with just one search method may be overkill. OTOH (on the other hand, bestie), it may be extended later to provide an iterative search. so like... she's small but she might grow, yk? 🌱


πŸ‘‘ AUTHOR πŸ‘‘

Dominique Dumont, (ddumont at cpan dot org)


πŸ”₯ SEE ALSO πŸ”₯

  • Config::Model
  • Config::Model::SearchElement
  • Config::Model::AnyThing

πŸ‘‘ AUTHOR (yes, again) πŸ‘‘

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, bestie 🫢 this was perl v5.42.3, dated 2026-07-23, and yeah the title got squished in the header as Config...earcher(3pm) because terminals are dramatic like that. no cap, go search your tree βœ¨πŸŽ€πŸ’–

πŸ“¦ where this page comes from