develooper Front page | perl.qpsmtpd | Postings from June 2005

uniq in perl

Thread Previous | Thread Next
From:
Bob
Date:
June 7, 2005 16:27
Subject:
uniq in perl
Message ID:
42A62EC7.7030202@nishanet.com
Do I need this? I'm getting six to nine dupes to the
same recipient from a worm, and even though I
can deny that worm at rcpt, I'd like to fix the hole,
wherever it is, that is allowing duplicate recipients
for one message.

sub _uniq {
 my %u = () ; for ( @_ ) { $_ and $u{$_} = 1 } ; keys %u if ref \%u ;
}

Fits into such--

for ( &_uniq ( $transaction->recipients ) ) { # queue ops




Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About