X-Git-Url: http://gb7djk.dxcluster.net/gitweb/gitweb.cgi?a=blobdiff_plain;ds=inline;f=perl%2FAnnTalk.pm;h=a6032363ac5e7cf5d847a288e36ed4f64bcd952f;hb=cdb2c0e3a1d778485f71d406a561b38ed5238dbc;hp=b082c38531bd0f77707129db1ac37b2250e62a86;hpb=88665a2bed3b9ec9e97237938a95a045b2a21bb4;p=spider.git diff --git a/perl/AnnTalk.pm b/perl/AnnTalk.pm index b082c385..a6032363 100644 --- a/perl/AnnTalk.pm +++ b/perl/AnnTalk.pm @@ -23,14 +23,14 @@ $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); $text = substr($text, 0, $duplth) if length $text > $duplth; my $dupkey = "$call|$to|$text"; 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; } @@ -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;