sub html_filter
{
# This sub provides basic filtering to encode problem characters.
# This basicially stops any HTML from working by replacing < and >.
# The last one replaces new lines with HTML line breaks for multi-line comments.

my ($data) = shift;			# Get the data to filter HTML from.
$data =~ s!"!\&quot\;!g;	# Replace double quotes with "&quot;".
$data =~ s!<!\&lt\;!g;		# Replace left  arrow (<) with "&lt;".
$data =~ s!>!\&gt\;!g;		# Replace right arrow (>) with "&gt;".
$data =~ s!\n!<br>!g;		# Seach for new lines and replace with "<br>".
return $data;				# Return the filtered data.
}
1;