Re: [htmltmpl] Comments
Brought to you by:
samtregar
From: Robert H. <si...@gm...> - 2007-03-07 20:36:59
|
Dan Horne wrote: > One way is to use H::T filters. You could have something like <rem> and > </rem> in your code, and use the filter functionality to remove the tags and > enclosed content. There will be a performance hit - it works okay for me but > YMMV > > Dan > sub tmpl_remark { my $text_ref = shift; $$text_ref =~ s|<rem>(\w+)</rem>||gx; } # passed to the template filter => \&tmpl_remark; I did not know you could use a regex in a substitute (or I never thought about doing so). Of course, the regex above is bogus as I am just seeing if that is correct form. Robert |