Akopia Akopia Services

[Date Prev][Date Next][Thread Prev][Thread Next][Interchange by date ][Interchange by thread ]

[ic] Trying to define a new filter



[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.




_______________________________________________
Interchange-users mailing list
Interchange-users@lists.akopia.com
http://lists.akopia.com/mailman/listinfo/interchange-users


Search for: Match: Format: Sort by: