I want a perl script ( to make a CGI ) which takes the values after "grade:" and before "<b>" for the line containing a name that I coose (for example "Guy 1"), and prints it to the screen when running it as a CGI on my webpage, something like this:

<html>
<head>
<title>CONGRATULATIONS TO THE PARTICIPANT Guy 1</title>
</head>
<body>
<h1>Guy 1</h1> Has just got a "100" as a
grade for this Seminar. Congratulations!!!<br>
</body>
</html>

Assuming that the format for every grade is '<b>NAME</b>, grade: GRADE<br>' and that there are no lines that begin incidentally with the same format (Well actually you don't have if you use the regex I wrote. At least I think so...), you can use this little snippet that uses regex to create this HTML page (You can easily alter it as you wish to just print it and not create an HTML file):

open (FILE, "+<$path/finalgrades.html") or die "Can't open file: $!"; +# where $path is the full path to the directory where the file reside+s.
while (<FILE>) {
if (m/^<b>[^<>]</b>, grade: (\d+)<br>$/) {
my $name = $1; my $grade = $2;
open (HTML, "+>>$path/$name.html") or die "$!";
print HTML "<html><head><title>CONGRATULATIONS TO THE PARTICIPANT +$name</title></head><body><h1>$name</h1> has just reviece "$grade" as+ a grade for this seminar. Congratulations!!!<br></body></html>
}
}
close (FILE) or die "$!";

A few corrections:
1. Replace "(Well actually you don't have if you..." with "(Well actually you don't have to worry about it if you...".
2. After the print HTML "bla bla" statement I forgot to include a ";", and you should add after it a "close HTML" statement too.