line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Email::ECGListe;
|
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
49085
|
use warnings;
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
32
|
|
4
|
1
|
|
|
1
|
|
5
|
use strict;
|
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
40
|
|
5
|
1
|
|
|
1
|
|
892
|
use Digest::SHA1 qw( sha1 );
|
|
1
|
|
|
|
|
933
|
|
|
1
|
|
|
|
|
102
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
our $VERSION = '0.07';
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
BEGIN {
|
10
|
1
|
|
|
1
|
|
7
|
use Exporter;
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
97
|
|
11
|
1
|
|
|
1
|
|
15
|
our @ISA = qw( Exporter );
|
12
|
1
|
|
|
|
|
2
|
our @EXPORT = qw( );
|
13
|
1
|
|
|
|
|
6
|
our %EXPORT_TAGS = ( );
|
14
|
1
|
|
|
|
|
770
|
our @EXPORT_OK = qw( &Abgleich );
|
15
|
|
|
|
|
|
|
} # BEGIN
|
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
sub Abgleich($$;$$$;$$$$;$$$$$) {
|
18
|
|
|
|
|
|
|
|
19
|
0
|
|
|
0
|
0
|
|
my ($dateiEcgHash, $dateiEin, $gesOrFixOrDel, $feld, $trennZ) = (shift, shift, shift, shift, shift);
|
20
|
|
|
|
|
|
|
|
21
|
0
|
0
|
|
|
|
|
die $! if not -e $dateiEcgHash;
|
22
|
0
|
0
|
|
|
|
|
die $! if not -e $dateiEin;
|
23
|
0
|
|
|
|
|
|
my $dateiAus = $dateiEin.".txt";
|
24
|
|
|
|
|
|
|
|
25
|
0
|
0
|
|
|
|
|
if (not($gesOrFixOrDel)) {
|
26
|
0
|
|
|
|
|
|
print "Bitte Dateiformat angeben (F/D/G): ";
|
27
|
0
|
|
|
|
|
|
chomp($gesOrFixOrDel = uc());
|
28
|
0
|
0
|
0
|
|
|
|
die $! if $gesOrFixOrDel ne "F" and $gesOrFixOrDel ne "D" and $gesOrFixOrDel ne "G";
|
|
|
|
0
|
|
|
|
|
29
|
|
|
|
|
|
|
} # if
|
30
|
|
|
|
|
|
|
|
31
|
0
|
|
|
|
|
|
$gesOrFixOrDel = uc($gesOrFixOrDel);
|
32
|
0
|
0
|
|
|
|
|
if (not($feld)) {
|
33
|
0
|
0
|
|
|
|
|
if ($gesOrFixOrDel eq "F") {
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
34
|
0
|
|
|
|
|
|
print "Bitte Stelle,Laenge eingeben: ";
|
35
|
0
|
|
|
|
|
|
chomp($feld = );
|
36
|
0
|
0
|
|
|
|
|
die $! if not $feld;
|
37
|
|
|
|
|
|
|
} # if
|
38
|
|
|
|
|
|
|
elsif ($gesOrFixOrDel eq "D") {
|
39
|
0
|
|
|
|
|
|
print "Bitte Feldnummer eingeben: ";
|
40
|
0
|
|
|
|
|
|
chomp($feld = );
|
41
|
0
|
0
|
|
|
|
|
die $! if not $feld;
|
42
|
0
|
|
|
|
|
|
print "Bitte Trennzeichen eingeben: ";
|
43
|
0
|
|
|
|
|
|
chomp(my $trennZ = );
|
44
|
0
|
0
|
|
|
|
|
die $! if not $trennZ;
|
45
|
|
|
|
|
|
|
} # elsif
|
46
|
|
|
|
|
|
|
elsif ($gesOrFixOrDel eq "G") {
|
47
|
0
|
|
|
|
|
|
print "Ganze Zeile ist die Emailadresse.\n";
|
48
|
|
|
|
|
|
|
} # elsif
|
49
|
|
|
|
|
|
|
else {
|
50
|
0
|
|
|
|
|
|
die $!;
|
51
|
|
|
|
|
|
|
} # else
|
52
|
|
|
|
|
|
|
} # if
|
53
|
|
|
|
|
|
|
|
54
|
0
|
|
|
|
|
|
my %verboten;
|
55
|
0
|
|
|
|
|
|
my ($bytes, $hashwert) = ("", "");
|
56
|
|
|
|
|
|
|
|
57
|
0
|
0
|
|
|
|
|
open(my $fhHash, "<", $dateiEcgHash) or die $!;
|
58
|
0
|
|
|
|
|
|
do {
|
59
|
0
|
|
|
|
|
|
$bytes = read($fhHash, $hashwert, 20);
|
60
|
0
|
|
|
|
|
|
$verboten{$hashwert} = 1;
|
61
|
|
|
|
|
|
|
} # do
|
62
|
|
|
|
|
|
|
while ( $bytes == 20 );
|
63
|
0
|
0
|
|
|
|
|
close($fhHash) or die $!;
|
64
|
|
|
|
|
|
|
|
65
|
0
|
0
|
|
|
|
|
open(my $fhEin, "<", $dateiEin) or die $!;
|
66
|
0
|
0
|
|
|
|
|
open(my $fhAus, ">", $dateiAus) or die $!;
|
67
|
|
|
|
|
|
|
|
68
|
0
|
|
|
|
|
|
while (my $zeile = <$fhEin>) {
|
69
|
0
|
|
|
|
|
|
chomp $zeile;
|
70
|
0
|
|
|
|
|
|
my $email = "";
|
71
|
0
|
0
|
|
|
|
|
if ($gesOrFixOrDel eq "F") {
|
|
|
0
|
|
|
|
|
|
72
|
0
|
|
|
|
|
|
my @aiFeld = ();
|
73
|
0
|
|
|
|
|
|
@aiFeld = split(/,/, $feld);
|
74
|
0
|
|
|
|
|
|
$email = substr($zeile,$aiFeld[0],$aiFeld[1]);
|
75
|
|
|
|
|
|
|
} # if
|
76
|
|
|
|
|
|
|
elsif ($gesOrFixOrDel eq "D") {
|
77
|
0
|
|
|
|
|
|
my @satz = ();
|
78
|
0
|
|
|
|
|
|
@satz = split(/$trennZ/, $zeile);
|
79
|
0
|
|
|
|
|
|
$email = $satz[$feld];
|
80
|
|
|
|
|
|
|
} # elsif
|
81
|
|
|
|
|
|
|
else {
|
82
|
0
|
|
|
|
|
|
$email = $zeile;
|
83
|
|
|
|
|
|
|
} # else
|
84
|
0
|
|
|
|
|
|
my $domain = "";
|
85
|
0
|
|
|
|
|
|
($domain = $email) =~ s%.*\@%%;
|
86
|
0
|
0
|
0
|
|
|
|
if (not($verboten{sha1($email)}) and not($verboten{sha1("\@".$domain)})) {
|
87
|
0
|
|
|
|
|
|
print $fhAus $zeile."\n";
|
88
|
|
|
|
|
|
|
} # if
|
89
|
|
|
|
|
|
|
} # while
|
90
|
|
|
|
|
|
|
|
91
|
0
|
0
|
|
|
|
|
close($fhEin) or die $!;
|
92
|
0
|
0
|
|
|
|
|
close($fhAus) or die $!;
|
93
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
} # Abgleich
|
95
|
|
|
|
|
|
|
|
96
|
|
|
|
|
|
|
1;
|
97
|
|
|
|
|
|
|
__END__
|