in reply to Resources for learning Perl with CGI?

Well, first off your code reads from STDIN like a c program. CGI is easier to use. Here's your code:
read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'}); $rating = substr($buffer,0,1); $table = substr($buffer,1,(length($buffer)+1));
Here's mine that does the same thing:
use CGI qw/:standard/; my ($rating, $table); if (param()){ $rating = param('rating'); $table = param('table'); }
Try reading the CGI documentation by using perldoc CGI

Especially read the section on debugging on the command line:

perl -e "use CGI qw/:standard :debug/; if(param()){print param('you') +};" you=hello hello
And before you are done you should read about tainted data. Your program takes information from the user and turns around and tries to write to a file. That is dangerous:
perl -Te "use CGI qw/:standard :debug/; $ms=param('you'); if (-f qq($m +s\.txt)){open(H,qq(>>$ms\.txt))};print <H>; close(H);" you=hello Insecure dependency in open while running with -T switch at -e line 1.

Celebrate Intellectual Diversity