in reply to $foo->bar = 14;
Having the lvalue return the hash element means the assignment, the setter part, is not under your control. You can't change the code behind setting the value (if the representation changed, for example) without affecting the callers. The only thing it does is let you change the name of the hash element (big deal), or hook "access" without caring whether it will be a get or set and without knowing the new value if a set.
So, I don't use it, since it doesn't do what I want of an accessor.
—John
|
|---|