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:
elementvaluekeysummarydescriptionhelpallβ this one searches in all the items above π the whole menu, no skips
π Methods
search
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::ModelConfig::Model::SearchElementConfig::Model::AnyThing
π AUTHOR (yes, again) π
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
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
- 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