added perl code to extract country codes