[ic] Trying to define a new filter
Jonathan Clark
jonc@webmaint.com
Sat, 14 Apr 2001 09:43:24 +0100
[ic 4.6.4 / RH6.2]
Hi All,
I am trying to define a new filter in a GlobalSub in interchange.cfg.
As per the
I have:
GlobalSub <<EOR
sub new_filter {
package Vend::Interpolate;
$Filter{reverse} = sub { $val = shift; return scalar reverse
val };
}
EOR
and, following a restart, on my page:
should be reversed:[filter reverse]jonathan[/filter]
but this produces:
should be reversed:jonathan
Looks like I'm not to be setting up the hash properly, I have tried to
follow the
docs(http://developer.akopia.com/cgi-bin/ic/docfly.html?mv_arg=ictags03%2e28
):
>You can define your own filters in a GlobalSub (or Sub or ActionMap):
>
> package Vend::Interpolate;
>
> $Filter{reverse} = sub { $val = shift; return scalar reverse $val };
>
>That filter will reverse the characters sent.
Please can someone tell me what I am doing wrong. If you can give me a
complete example of setting up this filter from a GlobalSub and Sub I will
add an annotation to the docs.
Thanks,
Jonathan
Webmaint.