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: <%-{-{-{-<
In reply to Re: Modification of a read-only value attempted
by AnomalousMonk
in thread Modification of a read-only value attempted
by josthi
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |