"be consistent" | |
PerlMonks |
Re: can sub check context for lvalue vs rvalue context?by LanX (Saint) |
on May 08, 2018 at 23:11 UTC ( [id://1214238]=note: print w/replies, xml ) | Need Help?? |
I don't think so, that's why you are not recommended to use lvalue methods as combined getter and setters. It initially works but if you ever need to do validation on the setter you are lost.
Though there was a costly workaround by returning a tied value (from TheDamian IIRC) which catches the STORE.
updateWell, if you are willing to install XS, you could use Devel::Callsite to find and parse the OP-Tree.
Cheers Rolf
In Section
Seekers of Perl Wisdom
|
|