Hash-Merge reviews

cpanratings
 

RSS | Module Info | Add a review of Hash-Merge

Hash-Merge (0.12) ****

I was using Hash::Merge::Simple, it was thrown a case where it fell into a deep recursion and took down one of our production machines. I switched to Hash::Merge, it handled the case perfectly. I'm not sure what is going on behind the scenes but Hash::Merge seems a bit more robust.

Marlon Bailey - 2010-07-12T08:28:27 (permalink)

0 out of 2 found this review helpful. Was this review helpful to you?  Yes No

Hash-Merge (0.07) ****

This module comes in very handy for those occasions where you have two (or more) hashes whose data you want to combine without clobbering duplicate key/value pairs. For example, merging { one => [ 1 ] } and { one => [ 2, 3 ] } yields { one => [ 1, 2, 3 ] }. Better yet, you control which hash (left or right) is given precedence in the case of scalar elements, so merging { one => 1 } and { one => 2 } can yield { one => 1 } or { one => 2 } depending on whether you set the precedence to left or right. Best of all, it works recursively with DWIMMERY! (Hint: to merge 3+ hashes, just do { $h = shift @hh; $h = merge($h, $_) foreach @hh }. One nit: the argument to set_behavior should be a string, e.g., Hash::Merge->set_behavior('RIGHT_PRECEDENT').)

Paul Hoffman - 2004-01-13T05:40:47 (permalink)

4 out of 4 found this review helpful. Was this review helpful to you?  Yes No