in reply to Re: Finding the sum of individual columns
in thread Finding the sum of individual columns
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; } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Finding the sum of individual columns
by Corion (Patriarch) on Apr 13, 2010 at 09:13 UTC | |
by jwkrahn (Abbot) on Apr 13, 2010 at 15:14 UTC | |
by thillai_selvan (Initiate) on Apr 13, 2010 at 09:22 UTC |