Problem in printing HTML content as plain text
Hello friends,
My code perl code is as below.I want to print the contents of file "/dir/Myfile".But problem is that the file "Myfile" contains html content as below.
<TP_INFO> <Mail> </Mail> </TP_INFO>
So the IE treats it as HTML content and doesnt print the content present in the tags.Can any one help me to print HTML content as plain text?
sub PrintLog
{
print "Content-Type: text/plain \n\n";
print "<HTML><HEAD><TITLE></TITLE></HEAD><BODY>\n";
open(PS,"cat /dir/Myfile |") || die "Failed: $!\n";
while ( <PS> )
{
print "$_\n";
print "<BR>\n";
}
print "</BODY></HTML>\n";
}
|