in reply to Adding Columns from Given Data
Could you give some more info about what you're trying to do. I think that this statement is the one that needs clarification:
The data for Qy-Py is taken from Px-Qx without modification except changing the order within the account block.
I dont see the correlation between Px-Qx and Qy-Py
Also, how is this data stored, is it an array of hashrefs? Or a text file just like you have it shown? or something else?