foreach (keys %tagdict){ print CF $tagdict{$_} if exists $tagcorpus{$_}; }