X-Git-Url: http://dxcluster.org/gitweb/gitweb.cgi?a=blobdiff_plain;f=perl%2FFilter.pm;h=4443fc5570ac2360d40af67587c5d10f028aeec4;hb=6c8062c1356fe49974da2df121852b41971f7b77;hp=0ca71917db987cb5637ebe5bec404b1ddb611e64;hpb=8178d787d7cc8040fa8958197582bba5c80e6f59;p=spider.git diff --git a/perl/Filter.pm b/perl/Filter.pm index 0ca71917..4443fc55 100644 --- a/perl/Filter.pm +++ b/perl/Filter.pm @@ -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};