Okay I have 2 files. One file is data that is updated every 10 minutes while the second is data that was previously used. What I am trying to do is take one line from the new file and loop through each line of the second file and see if it matches one. If it does I dont want to use it, but if there is no match than I want to add it to a string. In what I have done so far it seems that the check does not ever find a match even though there is one. Here is what I have and a sample of the data I have been using from both files. CHECKHAIL and USEDHAIL are the two files
while(my $toBeChecked = <CHECKHAIL>){
my $found = 0;
seek USEDHAIL, 0, 0 or die "$0: seek: $!";
while(my $hailCheck = <USEDHAIL>){
if( $toBeChecked == $hailCheck){
$found += 1;
}
}
print USEDHAIL $toBeChecked;
if ($found == 0){
$toEmail .= $toBeChecked;
}
}
print $toEmail;
return;
}
CHECKHAIL sample data
2226 175 2 NE LAWRENCE DEADWOOD SD 44.4 -103.7 (UNR)
2305 200 2 S SISKIYOU GREENVIEW CA 41.52 -122.9 2 INCH HAIL REPORTED WITH STORM JUST SOUTH OF GREENVIEW. (MFR)
2350 200 DANIELS E FLAXVILLE MT 48.8 -105.17 GOLF BALL TO HEN EGG SIZED HAIL (GGW)
2350 175 5 N DANIELS RICHLAND MT 48.89 -106.05 DESTROYED CROPS (GGW)
USEDHAIL sample data
2226 175 2 NE LAWRENCE DEADWOOD SD 44.4 -103.7 (UNR)
2305 200 2 S SISKIYOU GREENVIEW CA 41.52 -122.9 2 INCH HAIL REPORTED WITH STORM JUST SOUTH OF GREENVIEW. (MFR)