make the major mod to make PC16 the master record for triggering the update
[spider.git] / perl / Filter.pm
index 0ca71917db987cb5637ebe5bec404b1ddb611e64..4443fc5570ac2360d40af67587c5d10f028aeec4 100644 (file)
@@ -92,7 +92,9 @@ sub compile
        my $rr;
        
        if ($ref->{$ar} && exists $ref->{$ar}->{asc}) {
-               $ref->{$ar}->{code} = eval "sub { my \$r=shift; return $ref->{$ar}->{asc}; }" ;
+               my $s = $ref->{$ar}->{asc};     # an optimisation?
+               $s =~ s/\$r/\$_[0]/g;
+               $ref->{$ar}->{code} = eval "sub { $s }" ;
                if ($@) {
                        my $sort = $ref->{sort};
                        my $name = $ref->{name};