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
(addicted to the Perl Programming Language and ☆☆☆☆ :)
Wikisyntax for the Monastery
In reply to Re^3: can sub check context for lvalue vs rvalue context?
by LanX
in thread can sub check context for lvalue vs rvalue context?
by perl-diddler
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |