Config...:ListId(3pm)
π Config::ListId β the list-element glow-up for your config model π
okay bestie, so this is a Perl manual page, section 3pm, and it's literally all about Config::ListId β the class that handles list elements for a Config::Model config. Buckle up, it's cute and it's useful. π
β¨ NAME β¨
Config::Model::ListId β handles the list element for a configuration model. that's it, that's the whole job π
πΈ VERSION πΈ
version 2.166 β periodt, that's the one we're working with.
π¦ SYNOPSIS π¦
okay so like, don't come here looking for the whole rundown, because the actual synopsis lives elsewhere:
See "SYNOPSIS" in Config::Model::AnyId
go read that one, bestie, it's the main character of the synopsis situation π
π DESCRIPTION π
This class provides list elements for a Config::Model::Node. That's the vibe. It's the thing that makes listy config values behave. Slay. β¨
π CONSTRUCTOR π
do NOT create a ListId object yourself. literally just don't. it should never be created directly, no cap. π
π List model declaration π
for how you actually declare this in a model, head over to the model declaration section of Config::Model::AnyId. that's where the tea is β
π Methods π
π
get_type
Returns "list". iconic. short. perfect.
π
fetch_size
Returns the number of elements of the list. it's giving "how many things are in here" energy π’
π
load
Parameters: (string, [ check => 'no' ] )
Store a set of values passed as a comma separated list of values. Values can be quoted strings β like for real, i.e "a,a",b yields ('a,a', 'b').
"check" can be yes, no or skip. pick your fighter β¨
π
store_set
Store a set of values (passed as list).
If tinkering with check is required, use the following way :
store_set ( \@v , check => 'skip' );
π
move
Parameters: ( from_index, to_index, [ check => 'no' )
Move an element within the list. "check" can be 'yes', 'no', 'skip'. scoot over, bestie πΌ
π
push
Parameters: ( value1, [ value2 ... ] )
push some values at the end of the list.
π
push_x
Parameters: ( values => [ v1','v2', ...] , ... )
Like push with extended options. Options are:
checkβ Check value validaty. Either"yes"(default),"no","skip"valuesβ Values to push (array_ref)valueβ Single value to pushannotationβ (no description given in the original, so likeβ¦ it's there, and that's all we know π«Ά)
π
unshift
Parameters: ( value1, [ value2 ... ] )
unshift some values at the end of the list.
π
insert_at
Parameters: ( idx, value1, [ value2 ... ] )
unshift some values at index idx in the list.
π
insert_before
Parameters: ( ( val | qr/stuff/ ) , value1, [ value2 ... ] )
unshift some values before value equal to val or before value matching stuff.
π
insort
Parameters: ( value1, [ value2 ... ] )
Insert zz value on xxx list so that existing alphanumeric order is preserved.
β οΈ insort yields unpexpected results when called on an unsorted list. bestie. do not. sorted lists only or chaos ensues π
π
store
Equivalent to push_x. This method is provided to help write configuration parser, so the call is the same when dealing with leaf or list values. Prefer "push_x" when practical.
checkβ"yes","no"or"skip"annotationβ list ref of annotation to store with the list values
Example:
$elt->push_x (
values => [ 'v1','v2' ] ,
annotation => [ 'v1 comment', 'v2 comment' ],
check => 'skip'
);
π
sort
Sort the content of the list. Can only be called on list of leaf. leaf lists only, bestie, don't try it anywhere else πΏ
π
swap
Parameters: ( ida , idb )
Swap 2 elements within the array. tradesies π
π
remove
Parameters: ( idx )
Remove an element from the list. Equivalent to splice @list,$idx,1. bye bye element π
π
load_data
Parameters: ( data => ( ref | scalar ) [, check => ... ] [ , split_reg => $re ] )
Clear and load list from data contained in the data array ref. If a scalar or a hash ref is passed, the list is cleared and the data is stored in the first element of the list. If split_reg is specified, the scalar is split to load the array.
For instance
$elt->load_data( data => 'foo,bar', split_reg => qr(,) ) ;
loads [ 'foo','bar'] in $elt. boom, loaded, slay π₯
π
sort_algorithm
Returns a sub used to sort the list elements. See "sort" in perlfunc. Used only for list of leaves. This method can be overridden to alter sort order. custom sort vibes, if that's your thing π
π
get_info
Returns a list of information related to the list. See "get_info" in Config::Model::Value for more details. the info is over there, bestie π
π AUTHOR π
Dominique Dumont, (ddumont at cpan dot org)
πΈ SEE ALSO πΈ
Config::Model::ModelConfig::Model::InstanceConfig::Model::AnyIdConfig::Model::HashIdConfig::Model::Value
go read those too, the whole squad is iconic π
π AUTHOR (again, yes, for real) π
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 π«Ά written against perl v5.42.3, dated 2026-07-23, in section 3pm of the Perl docs. go forth and list responsibly π
β¨
π¦ 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