[Date Prev][Date Next][Thread Prev][Thread Next][Interchange by date
][Interchange by thread
]
Re: [ic] Trying to define a new filter
Quoting Jonathan Clark (jonc@webmaint.com):
> [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
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
--
Red Hat, Inc., 131 Willow Lane, Floor 2, Oxford, OH 45056
phone +1.513.523.7621 fax 7501 <mheins@redhat.com>
For a successful technology, reality must take precedence over public
relations, for Nature cannot be fooled. -- Dick Feynman
_______________________________________________
Interchange-users mailing list
Interchange-users@lists.akopia.com
http://lists.akopia.com/mailman/listinfo/interchange-users