It is possible to validate the values, it's just traditionally a pain in the arse, because it involves using something like Variable::Magic or returning a tied scalar.
I wrote LV to try to get around these issues, and it does indeed make writing lvalue subs pretty friendly. The primary drawback becomes speed - none of the implementations are as fast as a more traditionally written accessor.
In reply to Re^2: Is ": lvalue" attribute usefull or something to avoid?
by tobyink
in thread Is ": lvalue" attribute usefull or something to avoid?
by TomDLux
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |