If there is no mechanism presently, is this kind of thing worth implementing as a patch?
I don't know if there's an lvalue-sub way of doing that, but you could turn it all around, and not have a function that is an lvalue, but have an lvalue that is a couple of functions!
That's right, I'm talking about tie.
Unfortunately, I have not a clue what your code should do or why you would want to use a $foo_new, so I couldn't create an equivalent tie. Anyway, STORE serves as your islvalue condition, and FETCH for not islvalue, I think.package Tie::Fooz; sub TIESCALAR { bless \(my $dummy), $_[0] } sub FETCH { ${ $_[0] } } sub STORE { ${ $_[0] } = $_[1] } package main; tie my $foo, 'Tie::Fooz';
U28geW91IGNhbiBhbGwgcm90MTMgY
W5kIHBhY2soKS4gQnV0IGRvIHlvdS
ByZWNvZ25pc2UgQmFzZTY0IHdoZW4
geW91IHNlZSBpdD8gIC0tIEp1ZXJk
In reply to Re: Side Context in an 'lvalue' Subroutine
by Juerd
in thread Side Context in an 'lvalue' Subroutine
by tadman
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |