Perl and International Calling Codes
April 23rd, 2009Suppose you have a bunch of numbers and you wanna see which countries its from. It could be the first digit, second or even the third. Well.. you dunt look for country codes which is wrong in this aspect. You have to based on international calling codes which can be found on wiki
yes. i dunt see any modules by perl on international calling codes. only found those on country codes. well. you could do a screen scrap from a website doing a reverse look up on international calling codes, or you could have a file / database containing these info.
Well, i did up a list on a txt file as shown below using wiki:
hopefully it’ll be useful to someone as its formated from wiki to get pure countries<space>calling codes.
Whats next you might say.
you have to do a split in the number. search the first digit thru the db(which is imported from the txt-still need to convert to csv) or open file and search. If digit is not found get 2 digit->search and so on till the 3rd digit
and then if you cant get a match, just do a if else statement to say that the country cannot be found.
Maybe i’ll post the code another time in a .pm file
Well, thats all for now. let me know if i miss out something. =)
