Hash-AsObject reviews

cpanratings
 

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

Hash-AsObject (0.05) *****

I often find myself wanting to return a object instead of a hash because (to me) $item->foo looks neater than $item->{foo}. Hash::AsObject is perfect for this, plus there's the added benefit that if you need to make it a "proper" object later on, you won't have to change anything.

Hash-AsObject (0.05) *****

Ah, the beauty of dynamically typed languages. Frequently, you don't give a fig about the class of an object, you only care that it presents the correct interface. Hash::AsObject allows one to quickly and painlessly implement a simple interface when all you really need is to fetch data or conveniently store it. There's no need to mock up an interface or go through the trouble of instantiating an object merely for the purpose of providing a method call or two.

It's also great for prototyping an object that needs to be passed around but whose implementation has not yet been defined.