As an aside you should ditch the hand rolled param parser, see use CGI or die; for more details. You can replace all this:
if ($ENV{'REQUEST_METHOD'} eq 'GET') { $buffer = $ENV{'QUERY_STRING'}; } else { 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; $FORM{$name} = $value; }
With this which is much more reliable as well as shorter...
use CGI 'Vars'; my %FORM = Vars();
I would also recomend reading Use strict, warnings and diagnostics or die as well as New Monks
Imported Vars() method specifically as it is not part of the ':standard' set as pointed out by Coruscate
cheers
tachyon
s&&rsenoyhcatreve&&&s&n.+t&"$'$`$\"$\&"&ee&&y&srve&&d&&print
In reply to Re: Need help with writing to db file
by tachyon
in thread Need help with writing to db file
by webstudioro
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |