[ic] Trying to define a new filter

Jonathan Clark jonc@webmaint.com
Sat, 14 Apr 2001 10:27:25 +0100


> Looks like just a Perl problem -- you must use strict (i.e. my $val)
> and reference $val instead of val in your call. Also, you must have
> that in a BEGIN block to pick it up, otherwise you will have to
> call the globalsub before it is defined.
> 
> GlobalSub <<EOR
> sub new_filter {
>     BEGIN {
> 	package Vend::Interpolate;
> 	$Filter{reverse} = sub {
> 			    my $val = shift;
> 			    return scalar reverse $val;
> 			    };
>     }
> }
> EOR
> 
> -- 

Thanks, Mike.

That works great now. Note added to the docs.

Jonathan
Webmaint.