Here's a quick one that writes name and score to "score.txt":
Code:#!/usr/bin/perl -w use strict; use CGI; my $cgi = new CGI; # The file you want to write to. (chmod 777 score.txt) my $file = "score.txt"; # Print the correct header. print "Content-type: text/html\n\n"; # Open the file in appen mode open(OUT, ">>".$file) or die "Error opening file : $!"; # Append the score to the list: print OUT "Name:".$cgi->param('name').":Score:".$cgi->param('score')."\n"; close OUT; print "wrote_score=yes";




Reply With Quote