I only realized later that the version flattened to list, which I think was an ambiguity in my spec, i.e. "to make this work like map and grep", only for hashes. The spec was imperfect, but a valuable place to start, naively, to zero in on the real question (it's often hard to ask a precise question at the beginning of a task).
In fact, this school of programming already exists, and it's called "functional programming". That it's powerful is already demonstrated in many real world applications. map is borrowed from functional programming, and is the simplest, first order example of it. So at the heart of my question was is there any other functional programming support in Perl, besides map? For example transformations that take hashes to hashes, and can be composed? Let's try hmap.
It's not that I couldn't write the code for this myself (once I figured out what the spec actually was). However, there was the sneaking feeling that this was already done, well understood, and there would be better techniques for it.
Thanks for taking the time to answer my questions. I learn a lot with each round of discourse.
In reply to Re^6: map and grep (but for hashes)
by zerohero
in thread map and grep (but for hashes)
by zerohero
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |