>>>>> "Dave" == Dave Cash <dave-uXyrHUe9TpjYtjvyW6yDsg@xxxxxxxxxxxxxxxx> 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
<merlyn-DiZw3cqpylQkmLvzuZlaBw@xxxxxxxxxxxxxxxx>
<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!
|