AmandaBurke
Programmer
Hi,
I'm new to CGI/Perl programming and I'm having a lot of trouble with a script that I'm trying to get working. If some one could help me it would be great. Here is the code that I'm working on:
if ($ENV {'REQUEST_METHOD'} eq 'POST') {
read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'});
foreach $pair (split(/&/, $buffer)){
($key, $value) = split(/=/, $pair);
$key =~ tr/t/ /;
$value =~ tr/t/ /;
$value=~s/%/([a-fA-F0-9][a-fA-F0-9]/pack("C", hex($1))/eg;
$parameters{$key} = $value;
}
open (TEMP, ">>/cgi-bin/temp.dat"
;
open (FILE, "/cgi-bin/helplog.dat"
;
while($line = )
{
if ($name eq $parameters{searchfor})
{
print TEMP $line;
}
}
close (TEMP);
close (FILE);
I'm new to CGI/Perl programming and I'm having a lot of trouble with a script that I'm trying to get working. If some one could help me it would be great. Here is the code that I'm working on:
if ($ENV {'REQUEST_METHOD'} eq 'POST') {
read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'});
foreach $pair (split(/&/, $buffer)){
($key, $value) = split(/=/, $pair);
$key =~ tr/t/ /;
$value =~ tr/t/ /;
$value=~s/%/([a-fA-F0-9][a-fA-F0-9]/pack("C", hex($1))/eg;
$parameters{$key} = $value;
}
open (TEMP, ">>/cgi-bin/temp.dat"
open (FILE, "/cgi-bin/helplog.dat"
while($line = )
{
if ($name eq $parameters{searchfor})
{
print TEMP $line;
}
}
close (TEMP);
close (FILE);