in reply to Re: Re: LVALUE refs
in thread LVALUE refs

While this could be done, I think you'd find it not actually worth the effort, as it'll take more space and more time. The only real win would be in programmer efficiency.

Given that programmer efficiency isn't at all a bad thing, you can duplicate substr's functionality--just write your own (presumably overriding the core substr) and have it return tied scalars that substitute back in the original. You could even enforce same-size replacement this way if you want.