use warnings; #use strict; while (<DATA>) { chomp; tr/()/ /; @words = split; } $L=($words[2]+$words[5]); $D=($words[1]+$words[4]); $M=($words[3]+$words[6]); print "L=$L D=$D M=$M\n"; # Output: L=37 D=21 M=5 __DATA__ 25 ((18 25 4) (3 12 1))
In reply to Re: Trying to read numbers from a text file
by toolic
in thread Trying to read numbers from a text file
by biscarri
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |