I notice that this is your fisrt post, welcome to the Monastery! Please read the
if you have not already done so. I think it would be best if you post your Perl code and a short example of the input data. That way, people here can point out any problems or provide any enhancements to your code.
Hope this helps.