I normally do anything but ask for help with these things but it's becoming quite infuriating after trying a few methods of doing this. Obviously I'm missing the right design in my head for this so if anyone could be kind enough to at least give me a heads up on how to complete this code (it's literally the last thing I need to do.)
Essentially, I need to open the file (testers.txt) and then count how many times a particular word/faculty shows up. Then I'll print to screen, "There are $count testers in the $faculty faculty."
If I get answers of "do your own homework" I won't complain but I thought I might as well before I pull my hair out.
Code:
sub processForm(){
print start_html( 'Testers' );
$testersFile = ">>testers.txt";
open (OUTFILE, $testersFile) || die "Cannot open $testersFile : $!";
$surname = param('surname');
$forename = param('forename');
$name = uc($surname.'_'.$forename);
$num = param('ext_num');
$email = param('email');
$faculty = param('faculty');
print OUTFILE "$name,$num,$email,$faculty\n";
print '<center>You have been registered as a tester for the UITSD
software suite with the following details:</center>';
print br;
print "<center><table border=1>
<tr>
<td>Name</td><td>$forename $surname</td>
</tr><tr>
<td>Extension number</td><td>$num</td>
</tr><tr>
<td>Email</td><td>$email</td>
</tr><tr>
<td>Faculty</td><td>$faculty</td>
</tr>
</table></center>";
close (OUTFILE);
####INSERT CODE####
print end_html;
}
Essentially, I need to open the file (testers.txt) and then count how many times a particular word/faculty shows up. Then I'll print to screen, "There are $count testers in the $faculty faculty."
If I get answers of "do your own homework" I won't complain but I thought I might as well before I pull my hair out.
