in reply to Calculate jackknife error from of each column of a multi-column file
How do I remove this warning?
foreach my $j ($col_start .. $#column) { $n[$j] += 0; # add this to remove warning msg $x[$n[$j]][$j] = $column[$j]; $x_tot[$j] += $x[$n[$j]][$j]; $n[$j]++; }
Any other suggestions on my perl usage are also welcome
The lines:
my @n=0; my @x_tot=0; my @g_jack_av=0; my @g_jack_err=0;
Should be:
my @n; my @x_tot; my @g_jack_av; my @g_jack_err;
As you don't have to assign a value to the first array element.
|
|---|