in reply to to calculate mean and variance

What davidrw said about changing the split statement is bound to be the solution. I'd also point out this part of the error message:
... at meanStddev.pl line 6, <FILE> line 1
The message tells you not only where in your script you had a problem (line 6 of the perl code: $sum[$i]+=$fields[$i];), but also which line of data in your input data file had just been read when the error occurred. That is, the initial space is in line 1 of the data.