Catman..._array(3pm)

πŸ“¦
version 1.2025 Β· 4 versions
, in ubuntu resolute, ubuntu stonking

✨ NAME ✨

Catmandu::Fix::set_array β€” bestie, this one adds or changes the value of a HASH key or an ARRAY index and makes it an array πŸ’…

Oh also, this whole page lives in the User Contributed Perl Documentation section, so if you went looking for it under Catman..._array(3pm)… yeah that's the same girl, just with a cropped name πŸŽ€


πŸ¦‹ DESCRIPTION πŸ¦‹

Okay so here's the tea, and it's a big one πŸ“

Unlike add_field, this fix will not create the intermediate structures if they're missing. Nope. Not doing it. She said "if it's not already there, that's not my problem" 😭

So like… the path has to already exist, or she's just not gonna build it for you. Not her job, not her shift, no cap πŸ’€


🌸 SYNOPSIS 🌸

# Change the value of 'foo' to an empty array
set_array(foo)
# Or an array with initial contents
set_array(foo, "a", "b", "c")

Look at her go ✨ First form: set_array(foo) and boom, foo is now an empty array 🫢 Second form: set_array(foo, "a", "b", "c") and now foo is an array that already has "a", "b", and "c" sitting in it like the little icons they are πŸ‘‘

No extra keys invented, no sneaky structures spawned. She only touches what's already on the map, fr fr πŸ’–

πŸ’œ SEE ALSO πŸ’œ

  • Catmandu::Fix β€” go read that one too, she's the main character and this one is literally her supporting cast 🧚

k byeeee, this was perl v5.40.1, dated 2026-01-24, straight from the User Contributed Perl Documentation section πŸŽ€βœ¨

πŸ“¦ where this page comes from