in reply to Re: escapeHTML
in thread escapeHTML

sure thing:

this is just a sample of what i do, but i have a loop and fill a hash with text that may contain HTML, and then i push the reference of the hash to an array and then load the HTML::Template with that array, though when the loop in the .tmpl file is executed it will not display the text as escaped HTML text on the server... but it does on win32.
my (@tmp,$template); for (0 .. 4) { my ($test,$str); $str = "test   text $_"; $test{'TRY'} = escapeHTML($str); push (@tmp,\%test); } $template->param(TMP_LOOP => \@tmp);

Replies are listed 'Best First'.
Re: Re: Re: escapeHTML
by dws (Chancellor) on Jan 08, 2003 at 04:45 UTC
    You might have better luck by letting HTML::Template do the escaping for you. In your template, write
    <TMPL_LOOP NAME="TMPL_LOOP"> <TMPL_VAR NAME="TRY" ESCAPE=HTML> </TMPL_LOOP>
    and the right thing will happen.

      wow thanks, that ESCAPE = HTML did the trick!