There's more than one way to do things | |
PerlMonks |
Re^3: can sub check context for lvalue vs rvalue context?by LanX (Saint) |
on May 09, 2018 at 07:06 UTC ( [id://1214257]=note: print w/replies, xml ) | Need Help?? |
> Yeah, returning a tied value is what I was grudgingly working on, as I didn't think it would be very efficient There is probably a solution without XS ... You could compare the caller in the tied STORE and set a flag $islvalue for the next call. Like that only your first call would be inefficient.
Cheers Rolf
In Section
Seekers of Perl Wisdom
|
|