Here's mine that does the same thing:read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'}); $rating = substr($buffer,0,1); $table = substr($buffer,1,(length($buffer)+1));
Try reading the CGI documentation by using perldoc CGIuse CGI qw/:standard/; my ($rating, $table); if (param()){ $rating = param('rating'); $table = param('table'); }
Especially read the section on debugging on the command line:
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 -e "use CGI qw/:standard :debug/; if(param()){print param('you') +};" you=hello hello
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
In reply to Re: Resources for learning Perl with CGI?
by InfiniteSilence
in thread Resources for learning Perl with CGI?
by gotpong
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |