chomp($line) #line from FILE2
my ($zip_code,$city) = split /\|/,$line;
$zip_city{$zip_code} = $city; #insert city into hash
####
chomp($line);
my ($state,$min,$max) = split /,/,$line;
foreach my $current_zipcode ( keys %zip_city )
{
if ( $current_zipcode >= $min and $current_zipcode <= $max )
{
$zip_city_state{$current_zipcode}{city} = $zip_city{$current_zipcode};
$zip_city_state{$current_zipcode}{state} = $state;
delete $zip_city{$current_zipcode};
}
}
####
print "$zipfrom3,$zipzip_city_state{$zipfrom3}{city}, $zip_city_state{$zipfrom3}{state}\n";