Date sent: Thu, 7 Feb 2002 18:13:05 -0500 (EST) From: "Brett W. McCoy" <[EMAIL PROTECTED]> To: Jenda Krynicky <[EMAIL PROTECTED]> Copies to: "Beginners (E-mail)" <[EMAIL PROTECTED]> Subject: Re: accessing CGI.pm params directly
> On Thu, 7 Feb 2002, Jenda Krynicky wrote: > > > P.S.: I am not using Perl for CGI but ... I looked for a "proper" > > widely used & tested HTML escape function in the common modules and > > did not find any. I was not looking hard enough, right? > > You can use HTML::Entities and URI::Escape for escaping of stuff. I found URI::Escape (a function for encoding the values that are to become part ot the query string.) but I missed the HTML Entities. With that the code would be use HTML::Entities; use Interpolation query => sub { return encode_entities(scalar( $q->param($_[0]) )); }; print qq{<foo bar="$query{'baz'}" size=5> Hello World</foo>}; Thanks, Jenda =========== [EMAIL PROTECTED] == http://Jenda.Krynicky.cz ========== There is a reason for living. There must be. I've seen it somewhere. It's just that in the mess on my table ... and in my brain. I can't find it. --- me -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]