|Keep It Simple, Stupid|
Re: Why is a hash the default "object" in oo perl?by tinita (Parson)
|on Jul 18, 2004 at 01:51 UTC||Need Help??|
hmm, i thought about that and made up some code, just for fun.
i don't know if it's really useful and correct, but it was interesting to think about, so i'm just posting this here.
we're talking just about the object-attributes and the get/set methods, i assume.
so, when i create a class i usually find myself defining an attribute method like:
so that you can call $obj->name("new name");
(I know i could actually use Class::MethodMaker or something similar...)
now how could we make that more generic?
so with that, and the assumption that the module you inherit always uses methods to get/set attributes, you are independent from the implementation, right? here's attribute.pm:
update: changed subname '_attribute_set' to '_attribute_ref'
moved readmore tag a little