>>>>> "Dave" == Dave Cash <[EMAIL PROTECTED]> writes:

Dave> On Mon, 26 Jan 2004, Franco Bagnoli wrote:
>> I would like to define a plugin and a filter at the same time, say
>> 
>> [% USE format=MyFormat(options) %]
>> 
>> [% format("text") %] 
>> 
>> or 
>> 
>> [% FILTER format %]
>> 
>> text
>> 
>> [% END %]
>> 
>> Is it possible? (there is no Filter dir in which to put filters, and I do 
>> not want to alter  Filter.pm) 

Dave> To create a filter in a plugin, just call the define_filter() 
Dave> method on the $context (which you get as the second argument to
Dave> load() ).

Actually, for this syntax, you'd simply return from the plugin
constructor with a coderef that returns coderefs (a filter factory)
rather than a plugin object.  I'm not sure that's permitted by the
protocol though.  Andy?  Is that cheating?

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<[EMAIL PROTECTED]> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!

_______________________________________________
templates mailing list
[EMAIL PROTECTED]
http://lists.template-toolkit.org/mailman/listinfo/templates

Reply via email to