in reply to Re: Are lvalue methods (as properties) a good idea?
in thread Are lvalue methods (as properties) a good idea?
It's relatively clean to make the sub a closure on a tied scalar, where the STORE() method does the checking. That succeeds in highjacking assignment.
I gave an example in To Validate Data In Lvalue Subs. That still seems to me like a clean and flexible approach to validation. As mentioned in that thread, Attribute::Properties uses this technique under the hood, but as you say the tie-in to an attributes interface reduces its applicability.
After Compline,
Zaxo
|
---|