in reply to Strange behaviour when regex variable is modified during match?
My first thought are:Please define what you mean when you 'soft code' a variable. Please give an absolutely clear definition. Define this in general terms and then define again in the specific context of Perl. Two definitions required.
Define sandbox program. What is this?
If necessary use a footnote section at the bottom of your question.
I don't know the answer to your question. However I have a feeling that your problem might relate to multithreading and associated problems. If I am at all right in this 'feeling' (i.e. I don't know): Then you might need to tell us what processor chip your using.