X-Git-Url: http://dxcluster.org/gitweb/gitweb.cgi?a=blobdiff_plain;f=perl%2FWCY.pm;h=20b6a184274538fff31238586b6253911e4d46d6;hb=4e5b3de7a26563d94678fb790b8a1e2c4daaac8d;hp=ef1a9b21f523ed8a357ca930dabf6f8f4c68985a;hpb=e83b70ecab022dbbeac0b56f67ed2e4bed609e86;p=spider.git diff --git a/perl/WCY.pm b/perl/WCY.pm index ef1a9b21..20b6a184 100644 --- a/perl/WCY.pm +++ b/perl/WCY.pm @@ -231,7 +231,7 @@ sub dup # $text = substr($text, 0, $duplth) if length $text > $duplth; my $dupkey = "$d|$sfi|$k|$a|$r"; return 1 if exists $dup{$dupkey}; - $dup{$dupkey} = $d * 60; # in seconds (to the nearest minute) + $dup{$dupkey} = $d; # in seconds (to the nearest minute) return 0; } @@ -246,10 +246,13 @@ sub process sub listdups { + my $regex = shift; + $regex = '.*' unless $regex; + $regex =~ s/[\$\@\%]//g; my @out; - for (sort { $dup{$a} <=> $dup{$b} } keys %dup) { + for (sort { $dup{$a} <=> $dup{$b} } grep { m{$regex}i } keys %dup) { my $val = $dup{$_}; - push @out, "$_ = $val (" . cldatetime($val) . ")"; + push @out, "$_ = " . cldatetime($val); } return @out; }