in reply to Trying to read numbers from a text file

It might be easier to write out a regular expression for this:

while (<INFILE>) { chomp; m/(\d+)\s+\(\((\d+)\s+(\d+)\s+(\d+)\)\s*\((\d+)\s+(\d+)\s+(\d+)\)\ +)/; $L = $3 + $6; $D = $2 + $5; $M = $4 + $7; }

Well, it seemed like a good idea... (and it does pass the given test case)