On Mon, 8 Jul 2002, Philip S Tellis wrote:

> how about this:
>
> new HTML::Template(..., escape={
>       name => 'quote',
>       find => qr/(['"])/,
>       replace => '\$1'
> })

I think I'd prefer:

  escape => {
        quote => sub { $$_[0] =~ s/(['"])/\$1/g; }
  }

Or possibly setting $_:

  escape => {
        quote => sub { s/(['"])/\$1/g; }
  }

But that might be just a little too cute.

-sam




-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Oh, it's good to be a geek.
http://thinkgeek.com/sf
_______________________________________________
Html-template-users mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/html-template-users

Reply via email to