mrimagepueblo
Programmer
I don't know if this is enough information on the code but I think this is the subroutine that is messing up. I'm basically opening a 2nd data file (test.txt) and trying to read each line and run the lookup based on the original data file for matching results. I get the first line of the test.txt file ok and it sends the expected email, but it doesn't get through the remaining lines in the test.txt file?
Does this code look right to do that?
open (KEYWORDFILE, "test.txt") || die "can't open keyword file\n";
while (<KEYWORDFILE>)
{
@lines = (<KEYWORDFILE>);
foreach $line (@lines)
{
chop ($line);
@notifyfields = split(/\|/,$_);
}
$form_data{'id9'}= $notifyfields[9];
close (KEYWORDFILE);
}
}
#######
the $form_data('id9'}=$notifyfields[9]; matches the 9th field in the original data file to the 9th field in the test.txt, which causes the program to email me the results
Does this code look right to do that?
open (KEYWORDFILE, "test.txt") || die "can't open keyword file\n";
while (<KEYWORDFILE>)
{
@lines = (<KEYWORDFILE>);
foreach $line (@lines)
{
chop ($line);
@notifyfields = split(/\|/,$_);
}
$form_data{'id9'}= $notifyfields[9];
close (KEYWORDFILE);
}
}
#######
the $form_data('id9'}=$notifyfields[9]; matches the 9th field in the original data file to the 9th field in the test.txt, which causes the program to email me the results