Catman...d::list(3pm)

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

πŸ’– Catman...d::list(3pm) β€” bestie edition πŸ’–

okay so this is the page for Catman...d::list(3pm), from the User Contributed Perl Documentation, and it's literally all about Catmandu::Fix::Bind::list. pull up a chair, grab a boba, we're doing this πŸ§‹βœ¨


🌸 NAME 🌸

Catmandu::Fix::Bind::list β€” a binder that computes Fix-es for every element in a list

like. it's a binder. it binds. it does the thing to every single item in your list. iconic behavior honestly πŸ‘‘


✨ SYNOPSIS ✨

# Create an array:
#  demo:
#    - red
#    - green
#    - yellow

# Add a foo field to every item in the demo list, by default all
# fixes will be in context of the iterated path. If the context
# is a list, then '.' will be the path of the temporary context
# variable
do list(path:demo)
   if all_equal(.,green)
       upcase(.)
   end
end

# This will result:
#  demo:
#    - red
#    - GREEN
#    - yellow

# Loop over the list but store the values in a temporary 'c' variable
# Use this c variable to copy the list to the root 'xyz' path
do list(path:demo,var:c)
   copy_field(c,xyz.$append)
end

# This will result:
#  demo:
#    - red
#    - GREEN
#    - yellow
#  xyz:
#    - red
#    - GREEN
#    - yellow

so like, watch the green become GREEN. that's the glow-up fr fr πŸ’…


πŸ¦‹ DESCRIPTION πŸ¦‹

The list binder will iterate over all the elements in a list and fixes the values in context of that list.

translation bestie: it goes one by one through every element, no skipping, no shortcuts, and applies your fixes in the context of that list. main character energy for each item 🌈


πŸŽ€ CONFIGURATION πŸŽ€

🌟 path

The path to a list in the data.

πŸ’« var

The loop variable to be iterated over. When used, a magic temporary field will be available in the root of the record containing the iterated data.

✨ "magic temporary field" is a direct quote, not me being dramatic for once. it lives in the root of the record, and it's holding your iterated data. treat it with respect 🫢

πŸ‘‘ SEE ALSO πŸ‘‘

  • Catmandu::Fix::Bind

and that's the whole page, you ate it, no crumbs πŸ’–

perl v5.40.1 Β· 2026-01-24 Β· Catman...d::list(3pm) β€” mwah, love u, go bind some lists πŸŽ€πŸ¦‹πŸ’œ

πŸ“¦ where this page comes from