1. Added an efficiency thing for AUTOLOADed accessors from OO Perl by Conway.
[spider.git] / perl / WCY.pm
index acc522bd5a76f0abbd873c9828cf72ed488f9e6c..20b6a184274538fff31238586b6253911e4d46d6 100644 (file)
@@ -227,12 +227,11 @@ sub dup
        # dump if too old
        return 2 if $d < $main::systime - $dupage;
  
-       $d /= 60;                            # to the nearest minute
 #      chomp $text;
 #      $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; 
 }
 
@@ -247,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;
 }