in reply to RegEx misbehaving?

Without more data to go on this is somewhat of a guess, but try commenting out the last two lines of the while loop

051 $line=<TR_INFILE>; 052 chomp $line;

Each time around the loop, you are reading a line at the top of the while loop and processesing it. Then, when you reach these lines, you are reading another line from the file, chomping it and the looping back to the top to read another line. The line you read and chomped is therefore just discarded and never processed.


Examine what is said, not who speaks.
"Efficiency is intelligent laziness." -David Dunham
"When I'm working on a problem, I never think about beauty. I think only how to solve the problem. But when I have finished, if the solution is not beautiful, I know it is wrong." -Richard Buckminster Fuller