Magic isn't copied on assignment, not even for substr magic.
You did $r = func for my function, but $r = \func for substr. This difference in the code accounts for the difference in the results.
If I take your "persistant lvalueness" example and simply change substr to f, I get the same output as before the change.
Feel free to return a reference to targ instead of targ itself if that's what you want.
In reply to Re^11: XS: SvPVLV examples?
by ikegami
in thread XS: SvPVLV examples?
by BrowserUk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |