X-Git-Url: https://defaria.com/gitweb/?a=blobdiff_plain;f=maps%2Fbin%2Fadd2nulllist.pl;h=b6003c240350eeee3118f7ab85966757eb8bc077;hb=54fdcfd0cdc71457e3fae07fa28854546cf46e70;hp=27d694e29680333ad9b824771c3389778f1b4c02;hpb=e80b69bc05be9f38b1e4b9af37f3232f5004f5e4;p=clearscm.git diff --git a/maps/bin/add2nulllist.pl b/maps/bin/add2nulllist.pl index 27d694e..b6003c2 100755 --- a/maps/bin/add2nulllist.pl +++ b/maps/bin/add2nulllist.pl @@ -21,10 +21,10 @@ sub GetItems { my @items; - open FILE, $filename + open my $file, '<', $filename or error "Unable to open $filename - $!", 1; - while () { + while (<$file>) { my @fields = split; my %item; @@ -33,11 +33,13 @@ sub GetItems { $item{pattern} = $address[0]; $item{domain} = $address[1]; $item{comment} = $fields[1] ? $fields[1] : ''; - $itme{hit_count} = $fields[2] ? $fields[2] : 0; + $item{hit_count} = $fields[2] ? $fields[2] : 0; push @items, \%item; } # while + close $file; + return @items; } # GetItems @@ -82,6 +84,8 @@ sub Add2List { } # if $nextseq++; } # while + + return; } # Add2List # Main