use FindBin;
-use lib $FindBin::Bin, '/opt/clearscm/lib';
+use lib "$FindBin::Bin/../lib", '/opt/clearscm/lib';
use MAPS;
use MAPSLog;
my $Userid;
my $type = "null";
-sub GetItems {
- my $filename = shift;
+sub GetItems($) {
+ my ($filename) = @_;
my @items;
my @fields = split;
my %item;
- my @address = split /\@/, $fields [0];
+ my @address = split /\@/, $fields[0];
$item{pattern} = $address[0];
$item{domain} = $address[1];
return @items;
} # GetItems
-sub Add2List {
+sub Add2List(@) {
my @items = @_;
- my $sender = "";
- my $nextseq = MAPSDB::GetNextSequenceNo $userid, $type;
+ my $sender = '';
+ my $nextseq = GetNextSequenceNo($userid, $type);
- foreach (@items) {
+ for (@items) {
my %item = %{$_};
my $pattern = $item{pattern};
$sender = lc ("$pattern\@$domain");
- if (OnNulllist $sender) {
- display " Already on list";
+ if (OnNulllist($sender)) {
+ display ' Already on list';
} else {
- Add2Nulllist $sender, $userid, $comment, $hit_count;
- display " done";
+ Add2Nulllist($sender, $userid, $comment, $hit_count);
+ display ' done';
# Now remove this entry from the other lists (if present)
- foreach my $otherlist ("white", "black") {
- my $sth = FindList $otherlist, $sender;
+ for my $otherlist ('white', 'black') {
+ my $sth = FindList($otherlist, $sender);
my ($sequence, $count);
- ($_, $_, $_, $_, $_, $sequence) = GetList $sth;
+ ($_, $_, $_, $_, $_, $sequence) = GetList($sth);
if ($sequence) {
- $count = DeleteList $otherlist, $sequence;
+ $count = DeleteList($otherlist, $sequence);
} # if
- } # foreach
+ } # for
} # if
+
$nextseq++;
} # while
# Main
my $filename;
-if ($ARGV [0]) {
+if ($ARGV[0]) {
$filename = $ARGV[0];
} else {
error "Must specify a filename of addresses to null list", 1;
} # if
-SetContext $userid;
+SetContext($userid);
$Userid = ucfirst $userid;
-Add2List (GetItems $filename);
+Add2List(GetItems ($filename));
exit;