Catman..._field(3pm)
π NAME π
bestie. okay so. Catmandu::Fix::set_field β it adds or changes the value of a HASH key or an ARRAY index. that's it. that's the whole job. it's giving tiny fix, main character energy. π
π¦ DESCRIPTION π¦
so like, set_field changes a value that's already there. it does not build out the path for you.
and the way that it's not like add_field?? add_field will happily create the intermediate structures if they're missing. set_field will not. no cap. if the stuff along the way isn't already sitting there, she's not making it appear out of thin air, she's just not that girl. π
lowkey important: this is contrary to add_field. that's literally the difference between them. don't come for me when your deep nested key does nothing. π
β¨ SYNOPSIS β¨
# Change the value of 'foo' to 'bar 123'
set_field(foo, 'bar 123')
# Change a deeply nested key
set_field(my.deep.nested.key, hi)
# If the second argument is omitted the field has a null value
add_field(foo)
okay so quick tour: first one changes the value of 'foo' to 'bar 123' π. second one changes a deeply nested key, my.deep.nested.key, to hi πΈ. third one β if you leave the second argument out, the field has a null value, so no value, just vibes β¨.
(and yes, that third line says add_field(foo). i am reading it to you exactly as written, bestie, i do not make the rules, i just deliver them. π«Ά)
π SEE ALSO π
Catmandu::Fixβ go read her, she's the icon holding the whole thing together π
that's the whole page fr fr. source/version check: this is perl v5.40.1, dated 2026-01-24 β so like, she's fresh, she's current, she's serving. π go forth and set_field responsibly (and remember the intermediate structures thing, i'm begging π). ππ§β
π¦ where this page comes from
- ubuntu resolute: libcatmandu-perl 1.2025-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libcatmandu-perl 1.2025-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms