But I can't get the sum in the $val variable. Can you please help meopen FH,"<data_input" or die "Can't open file : $!\n"; my @line; while ( <FH> ) { if ( /(obj[1-9]*)/ ) { my $line = $'; #for getting other than obj column in the line my $val=0; $val += split(' ',$line); print $val; } }
In reply to Re^2: Finding the sum of individual columns
by thillai_selvan
in thread Finding the sum of individual columns
by thillai_selvan
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |