in reply to Hacker Proofing My First Script
You're importing "use CGI" but making very little use of it. There's no need for the code above. It can become messy. To get to the individual values from the submission, you can do this:# Your code use CGI; read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'}); @pairs = split(/&/, $buffer); foreach $pair (@pairs) { ($name, $value) = split(/=/, $pair); $value =~ tr/+/ /; $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg; }
my $comments = $q->param('comments');
my %params = map { $_ => $q->param($_) } $q->param; # comments stored in $params{'comments'}
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Hacker Proofing My First Script
by davido (Cardinal) on Sep 30, 2004 at 07:14 UTC |