G
Geoff Cox
Hello,
In the following code minorlist contains a list of names of schools.
The major list conatins these names as part of school email addresses
with other school email addresses.
I am trying to take the first word on each line of the minorlist, find
the associated email address in the majorlist and print the email
address out to the emails file.
For some reason the emails list contains all the emails in the
majorlist and I cannot see why?!
Cheers
Geoff
open (IN, "d:/minorlist");
open (INN, "d:/majorlist");
open (OUT, ">>d:/emails");
while (defined (my $line =<IN>)) {
$line =~ /^(.*?)\s/i;
&email($1);
}
sub email {
while (defined (my $line2 = <INN>)) {
if ($line2 =~ /$1/i) {
print OUT ($line2);
}
}
}
In the following code minorlist contains a list of names of schools.
The major list conatins these names as part of school email addresses
with other school email addresses.
I am trying to take the first word on each line of the minorlist, find
the associated email address in the majorlist and print the email
address out to the emails file.
For some reason the emails list contains all the emails in the
majorlist and I cannot see why?!
Cheers
Geoff
open (IN, "d:/minorlist");
open (INN, "d:/majorlist");
open (OUT, ">>d:/emails");
while (defined (my $line =<IN>)) {
$line =~ /^(.*?)\s/i;
&email($1);
}
sub email {
while (defined (my $line2 = <INN>)) {
if ($line2 =~ /$1/i) {
print OUT ($line2);
}
}
}