To match the address:
open (EML, "<$some_database") or die "Could not open $some_database: $!";
while (chomp ($_ = <EML>)) {
if (/^\Q$in{'Email_Field'}\E$/) {
$found = 1;
last;
}
next;
}
close EML;
...then it is just a matter of checking whether $found equals 1 or 0. If it is 0 you can print the email to the file, otherwise show an error...eg....
$found ? error() : print_to_file();
Code:
my $found = 0; open (EML, "<$some_database") or die "Could not open $some_database: $!";
while (chomp ($_ = <EML>)) {
if (/^\Q$in{'Email_Field'}\E$/) {
$found = 1;
last;
}
next;
}
close EML;
...then it is just a matter of checking whether $found equals 1 or 0. If it is 0 you can print the email to the file, otherwise show an error...eg....
$found ? error() : print_to_file();