I agree that is much easier to understand - I implemented the changes and still get the same issue. I am starting to think it is more to do with the XS interface than the .pl file itself. The suspicious line is the
statement.... what does this do with memory??
one other thing - I was unable to add warnings to my code, I will have to try and find out why I dont have that on the system.....