perl html エスケープ
# HTML
my $html = qq|<script language="JavaScript">alert('にょろ');</script>\n|;
# 関数 xss()
print xss($html);
sub xss {
my $str = shift || return(undef);
$str =~ s/&/&/g;
$str =~ s/</</g;
$str =~ s/>/>/g;
$str =~ s/\"/"/g;
$str =~ s/\'/'/g; return($str);
}