> What I would like is to only include a new IP if 
> $rejected{$_} > $tolerate (which is currently working) and the IP 
> isn't currently in the original IP list.

> 
> my $BlacklistedIPs = $cli->GetBlacklistedIPs();
> foreach (keys %rejected)
> {
>     $BlacklistedIPs .= "\\e$_"  if ($rejected{$_} > 
> $tolerate); } $cli->SetBlacklistedIPs($BlacklistedIPs);
> 
> The contents of $BlacklistedIPs looks like:
>  
> 61.144.183.76\e80.15.130.137\e221.224.88.237\e211.211.95.210\e
> 
> Would anyone like to take a stab at this?

my %bl = map {$_=>$tolerate+1} split /\\e/, $cli->GetBlacklistedIPs();
$bl{$_} = $rejected{$_} foreach keys %rejected;
$cli->SetBlacklistedIPs(join "\\e", grep {$bl{$_}>$tolerate} keys %bl);


It would be nicer if your $cli object could get/set lists instead of
delimited strings--it would make the above shorter.

-- 
Mark Thomas         Internet Systems Architect
[EMAIL PROTECTED]           DigitalNet, Inc.

$_=q;steal Porch Junk;;split//;$_=q=cd0153e71;
s/56s/45;39fs/=;y;\;s/;a28s/;;;s;$/;;;s((.))/;
q.$_[..$..$_[10].$_[2].q.x..q.($1)]./gee/print

_______________________________________________
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to