# html_escape.pl -- escape html text # $Id$ # Carlos Duarte, 990207/990222 use strict; # args: t1, t2, ... # ret: escaped t1, escaped t2, ... sub html_escape { my $hh; my @out; while (defined($hh = shift)) { $hh =~ s/&/&/g; $hh =~ s/\"/"/g; $hh =~ s//>/g; push(@out, $hh); } return @out; } # test print &html_escape(<<'EOF'),"\n";

1

par ""##$$%%&&

par2 EOF