PERL
14
survey
Guest on 30th April 2022 11:45:46 PM
#!/usr/bin/perl -w
#survey.cgi
print "Status: 200 weee\nContent-type: text/html\n\n";
use CGI;
$data = new CGI;
$newgod = $data->param("god");
#
# Open da file for da reading
open(FILE
, "<survey.data") or die "Unable to open file";
$index = 0;
while ($god[$index] = <FILE>)
{
$count{$god[$index]}++;
$index++;
}
foreach $name (keys %count)
{
print "Previous answer: $name $count{$name} \n";
}
#
# Open da file for da riting
#
open(FILE
, ">survey.data") or die "Unable to open for writing\n";
for($i = 0; $i < $#god; $i++)
{
}