Honestly, what happens to the data after this step is a bit of a mystery to me. $X, $Y, and $Z are passed through some impressively scientific mathematical translations that I simply do not understand nor do I have the time to. The code is converting from polar coordinates to rectangular coordinates, pushing those values into a vector, performing some math, and then stuffing everything into several references to global variables in various states. Calling it ugly is a disservice to ugly things. The people that wrote this are so much more intelligent than I am that they did not feel the need to comment the code.
I think I was looking for an answer like "when you use split, it doesn't fibulate the $data into the cranjux, you just need to use a different delimiter is all." But life can't be simple.
I'll try using the anchors. I had tried using + over *. If nothing else works I'll try using a different delimiter coming back from the database and then converting it back just after this step. This is a CGI script (written in 2016, so that should give you an indication of the mentality here). I don't fully understand the data, so logging is not quite as helpful as you might think, and printing to the page could cause the whole thing to fall over.
Thanks anyways. Please know that my sarcasm was not directed at you.