4 # Modified by Edwin Lima (edwinlima@hotmail.com; edwin.lima@nec-computers.com)
5 # Date: 08/21/01, The Netherlands
6 # $f: Variable used as a flag to create the list of questions on top of the question-answers set. This
7 # is the only way that I found to scan the questions which have a <CR><LF>, in such a way that I will not
8 # scan the answer together at same time.
9 # @aname: Buffer used to store the question-answers set to print them out just after the print of the
11 # @href: Buffer used to store the anchors (only questions) to the questions-answers set on the bottom
13 # I opened explicitly the file for input (input.txt) but U can change this as it was originally.
17 #comment this line if you are not open the file explicitly
18 #open(IN, "input.txt") || die "cannot open file input.txt" ;
20 print("<A name=TOP>") ;
22 #Uncomment line bellow to make it work as it was originally.
30 push(@aname,"<h1>$1</h1>\n");
32 } elsif (/^\*\* (.*)$/) {
33 push(@aname, "<h2>$1</h2>\n");
34 push(@href, "<h2>$1</h2>\n");
35 } elsif (/^\*\*\* (.*)$/) {
36 push(@aname, "<h3>$1</h3>\n");
39 push(@aname, "<p>\n");
40 # push(@href, "<p>\n"); NOT NEEDED
41 } elsif (/^\t\t\* (.*)$/) {
42 push(@aname, "<li>$1\n");
43 } elsif (/^Q: (.*)$/){
44 push(@aname, "<p><a name=\"q$q\"></a><b>Question $q:</b> $1\n");
45 push(@href,"<p><a href=\"#q$q\"><b>Question $q:</b></a> $1\n");
48 } elsif (/^A: (.*)$/){
49 push(@aname,"<P>\n<A HREF=#TOP>Top</A>\n<P>");
52 } elsif (/^TODO=(.*),$/){
53 push(@aname, "<a name=\"$1\">\n");
54 #push(@href, "<a name=\"$1\">\n");
63 foreach $line (@href) #"\n\n";
68 foreach $line (@aname) #"\n\n";
74 #comment this line if you are not open the file explicitly
75 # close(IN) || die "cannot close file" ;