in reply to Refusal to Run
Once the until statements are fixed,
and a my $i; is added, you have a divide by zero in my $deviation=sqrt($tot/$i);. How are you executing this, if it is a *nix you need a #! line, if win32, ther could be a problem with your install.
UPDATE: removed the my $i, the line my $deviation=sqrt($tot/$n); changed to my $deviation=sqrt($tot/$i); from the first time I downloaded until I looked again.
UPDATE: fixed the formating errors of the firs update...