I'm creating a script which will allow my visitors to imput number values as ratings, have them added (or weighted) and emitted into a file which takes the name of the thing rated. (out of 100)
I used
open (LOG, ">>../smee/$name.txt") || &ErrorMessage;
print LOG "+$smeerating\n";
close (LOG);
to create the file, which will also create any file should it not exist.
Well, I want to be able to add all the ratings of that file together and divide by the AMOUNT OF RATINGS (effectively giving an average rating).
I've tried everything I could, and nothing has worked. Please provide some insight into how I can do this!
I used
open (LOG, ">>../smee/$name.txt") || &ErrorMessage;
print LOG "+$smeerating\n";
close (LOG);
to create the file, which will also create any file should it not exist.
Well, I want to be able to add all the ratings of that file together and divide by the AMOUNT OF RATINGS (effectively giving an average rating).
I've tried everything I could, and nothing has worked. Please provide some insight into how I can do this!