in reply to Modification of a read-only value attempted

I agree with choroba's reply that the error you describe does not seem possible given the OPed code.

Please see Short, Self-Contained, Correct Example and perhaps try to reproduce the problematic behavior in a small code example (using a clearly defined string, not a mish-mash). If what's going on doesn't become evident in the process of writing and running the SSCCE, you can post it for comment.


Give a man a fish:  <%-{-{-{-<