| Module Info
| Add a review of Data-Rmap
This module is so useful and so often needed that its functions ought to be incorporated into perl itself, or at least the module ought to be (perhaps cleaned up a tad and) incorporated into the core.
I rolled my own recursive data structure walker a long time ago and added it to my copy/paste library, but Data::Rmap is my go-to now. Love it.
A very handy utility, sort of like s/// on your nested data structure instead of just strings. One nitpick: no coderef support. I needed to replace all coderefs inside a data structure into a string, since I want to pass it to JSON encoder. None of the rmap_*() functions seem to let me get to the coderefs. (RT wishlist ticket added.)
UPDATE 2011-12-30: The author (Brad) quickly responded to my RT ticket and added rmap_code. Upgrading from 4- to 5-star :) Regexp support is not there yet though, and I have suggested the ability to get all kinds of Perl-specific and weird objects, because one of the main uses of Data::Rmap for me is to "clean" a data structure to pass to non-Perl systems.
Effective module that extends Perl's 'map' to recurs through complex data structures.
This is an indispensable and powerful jewel! For me it has reduced programming time and increased the cleanliness and clarity of my code.
I was looking for a simple way to transform all DateTime objects in my data structure into string (e.g. "2010-07-06"). After failed experiment with Data::Walk and dumping Data::Transformer due to unsightly interface, I found Data::Rmap. It's straightforward to choose.
My only complaint would be the name: it's not immediately searchable (I was searching for 'data modify', 'data walk', 'data traverse', 'modify data inplace', and the like). Also, the name "map" suggests that the function will return a copy of the data (like Perl's builtin map) instead of modifying inplace.
Nice! A simple, well-thought-out interface to arbitrary data structure traversal. Some sort of hook for classes (e.g. an "_rmap" sub) would be a nice addition.
This a very useful module that generalizes perl's built-in 'map' function to operate on complex data structures. It's really simple to use and does what it claims to do. My only quibble is that the examples in the SYNOPSIS are complex and highlight advanced features rather than showing how easy it is to use the module in what-to-me seem typical cases.
Excellent and handy module! Thanks!
Great module, kudos to Brad Bowman! I think this is the kind of stuff (like Data:Dumper, Memoize) that makes Perl unique among other scripting languages. I can't agree more with what the previous reviewer said: "more people should hear about it".
Really useful module, more people should hear about it. The rating system forces you to consider things in depth so I guess thats the only reason I was critical of the interface - having some stuff export by default and some stuff export by request just isn't my preference - however it was mainly the rating system that made me have to think about this, a few seconds with the pod overcame it.