You can search for any group of strings you wish to. The problem is, what are the possible values. Will it be the English name or the German on: Germany or Deutchland? Will it be the current name or an older one: Myamar or Burma? Sri Lanka or Ceylon? Mumbai or Bombay?
If you have a file with one value per line, you can use "grep -f countries datafile" to examine datafile for all the countries in the countries file. The perl equivalent is simple:
my $re_text = join '|', map {($_)} @countries; my $re = rx/$re_text/;
while ( my $line = <$fh>) { chomp $line; my $found = ($line =~ /$re/); # Profit! }
As Occam said: Entia non sunt multiplicanda praeter necessitatem.
In reply to Re: Perl Module for identifying country name
by TomDLux
in thread Perl Module for identifying country name
by maheshkumar
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |