made some changes for perl 5.6
[spider.git] / perl / AnnTalk.pm
index faa644a302c99c3c204df7d2f834ca2a61ee74ef..a6032363ac5e7cf5d847a288e36ed4f64bcd952f 100644 (file)
@@ -23,7 +23,7 @@ $dupage = 24*3600;               # the length of time to hold spot dups
 sub dup
 {
        my ($call, $to, $text) = @_; 
-       my $d = $main::systime / 60;
+       my $d = $main::systime;
 
        chomp $text;
        unpad($text);
@@ -45,13 +45,17 @@ 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;
 }
 
+
 1;