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)
In reply to Re: Trying to read numbers from a text file
by jcb
in thread Trying to read numbers from a text file
by biscarri
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |