chomp($line) #line from FILE2 my ($zip_code,$city) = split /\|/,$line; $zip_city{$zip_code} = $city; #insert city into hash