Config...:HashId(3pm)
π Config::Model::HashId β the perl manpage, but make it cute β¨
okay bestie, gather round, because we're talking about Config::Model::HashId from the User Contributed Perl Documentation. She handles hash elements for your configuration model, and honestly? she's giving main character energy. π
πΈ NAME πΈ
Config::Model::HashId β Handle hash element for configuration model π«Ά
β VERSION β
version 2.166 β that's the one, no cap.
π SYNOPSIS π
literally just go read the synopsis in Config::Model::AnyId, bestie. that's where the goods are:
See "SYNOPSIS" in Config::Model::AnyId
π¦ DESCRIPTION π¦
so this class provides hash elements for a Config::Model::Node. that's the whole vibe. β¨
and the hash index? she can be an enumerated type, a boolean, an integer, or a string. options, queen. π
π CONSTRUCTOR π
HashId objects should NOT be created directly. please. i am begging. do not do it yourself. π
π Hash model declaration π
head over to the model declaration section of Config::Model::AnyId β that's the blueprint, that's the assignment. π
β¨ Methods β¨
π get_type
Returns "hash". that's it. that's the whole personality. iconic.
π fetch_size
Returns the number of elements of the hash. counting era fr fr. π’
π sort
Sorts an ordered hash. and if you call it on a non ordered hash? it throws an error. read her. π
π insort
Parameters: key
Creates a new element in the ordered hash while keeping the keys in alphabetical order. so tidy, so organized, we love a structured queen. π
Returns the newly created element. π
Throws an error if you call it on a non ordered hash. nope, not today.
π firstkey
Returns the first key of the hash. Behaves like the each core perl function. classic behavior, no surprises. π
π nextkey
Returns the next key of the hash. Behaves like the each core perl function. same energy, next in line. β¨
π swap
Parameters: ( key1 , key2 )
Swaps the order of the 2 keys. and if the hash isn't ordered? it's just ignored. we move on. π
π move
Parameters: ( key1 , key2 )
Renames key1 in key2. glow-up for a key, honestly. β¨
There's also an optional check parameter to disable the warning:
move ('foo','bar', check => 'no')
π move_after
Parameters: ( key_to_move [ , after_this_key ] )
Moves the first key after the second one. If the second parameter is omitted, the first key gets placed in first position instead. Ignored for non ordered hash. π
π move_up
Parameters: ( key )
Moves the key up in an ordered hash. Attempting to move up the first key of an ordered hash is ignored β she's already at the top, bestie, she cannot go higher. π Ignored for non ordered hash.
π move_down
Parameters: ( key )
Moves the key down in an ordered hash. Attempting to move up the last key of an ordered hash is ignored (yes, it says "move up" there, that's the note as written π). Ignored for non ordered hash.
π load_data
Parameters: ( data => ( hash_ref | array_ref ) [ , check => ... , ... ])
Loads data as a hash ref for a standard hash. π
For an ordered hash, you should load it with an array ref, or with a hash containing a special "__order" element. like, e.g. loaded with either:
[ a => 'foo', b => 'bar' ]
or
{ __order => ['a','b'], b => 'bar', a => 'foo' }
and if the loading order truly doesn't matter to you? there's a "__skip_order" parameter:
{ __skip_order => 1, b => 'bar', a => 'foo'}
load_data can also be called with a single ref parameter. π«Ά
Returns 1 if some data was loaded.
π get_info
Returns a list of information related to the hash. more deets over at "get_info" in Config::Model::Value. go look, iykyk. π₯
π AUTHOR π
Dominique Dumont, (ddumont at cpan dot org)
π SEE ALSO π
Config::ModelConfig::Model::InstanceConfig::Model::AnyIdConfig::Model::ListIdConfig::Model::Value
π AUTHOR π
Dominique Dumont β yes again, she wrote it, she's the moment, periodt.
π 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 thing, bestie!! πΈπ¦β¨ this page came from the User Contributed Perl Documentation, shipped with perl v5.42.3, dated 2026-07-23. slay, ate, no crumbs left. π ππ
π¦ 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