...you would have to evaluate the right hand side before the left hand side...
I'm not sure that I understand you. The right-hand side of an assignment is always evaluated before the assignment can occur? Except maybe in the case of assigning a constant, but even then the value of that constant is fetched from wherever before it can be assigned to the lvalue.
It's quite possible that I do not fully grasp the purpose or magic that lies behind the implementation of lvalue subs, but any code in an lvalue sub is invoked as a sideeffect of the assignment to an lvalue sub:
{ my $x; sub x: lvalue { print 'fred'; $x } }; x = 123; fred
The problem is that you can't do anything useful with that code as you cannot affect the outcome of the assignment relative to the value being assigned.
In reply to Re^3: Experimenting with Lvalue Subs
by BrowserUk
in thread Experimenting with Lvalue Subs
by Limbic~Region
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |