[ back to toc ]

Perl and Textfile handling

Date: 2002/04/19 10:44

Q:
Hello
I've written one perl script for storing the results of quiz results into
text file.
Now the program is ok.It stores the counter values in the text file as I
wish.I need to use the HTML table format to write the perl program
results(quiz) into the text file.
How do I use HTML tags in Perl program?
I did try by using
print "<table>\n";
print "<tr>$value1</tr><\n";
like this...
It's written into the text file as such.
<table>
<tr>15</tr>
like ....
I want the data to be in table format in text file.
How do I handle this.Can you please give your ideas.
Thanks in advance
*NAME-DELETED*

A:
I do not really understand what your problem is. You say that you can open
a text file and write a counter into it. Writing HTML is just the same as
writing anything else.

open(F,">file");
print F "<HTML><BODY><TABLE>
<TR><TD>$value1</TD></TR>
</TABLE>";
close F;

will create a table with a single element.

Regards,
Peter

[ back to toc ]