Thanks for all the help...
Sorry if I was a bit vague in my question. I am basically searching through a XML file for a value and replacing it with a new value. It was not as easy as I had origonally thought, but I have managed to get around the problem by adding a few ~~~~~ at $1$paranum~~~~~$3/si) {
and then searching for $ts=~s/~~~~~//gis; after the loop.
It is a bit of a hack but it serves my purpose for now.
Thanks for all the help.
Jeremy
wow. that's a bad, bad hack. you should not have to do that, and you should not do that! please, try XML::Simple. it's well documented, easy to use, and we'll be happy to help with any problems you might come across.