Yes, that's what it's for, although your naming really sucks, and you're using || '' against the wrong thing.
my $comment = $cgi->param('comment') || ''; # or whatever ... my $comment_html = $cgi->escapeHTML($comment); print header(); print "<p>Comments: $comment_html\n";
In reply to Re^3: Best way to use escapeHTML
by ikegami
in thread Best way to use escapeHTML
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |