in reply to while question

It looks like your valid data lines only match /^(\d+(?:\.\d*))\|/, so you want to only add if the line matches. What you've done is unconditionally add whatever was left in $value from the last time through your loop.

Update: Also, read perldoc perlstyle and look into perltidy presuming that's actually how your code is formatted. Better indentation might help you visualize the flow and have helped you catch this.

--
We're looking for people in ATL