Geo::CountryFlags can dynamically fetch flag gif's from CIA.
SYNOPSIS
use Geo::CountryFlags
$gcf = new Geo::CountryFlags;
return a local path to the flag file fetch the file from CIA if necessary and put it in the flag directory
$flag_path = $gcf->get_flag($country_code,[flag_dir])
default:
flag_dir = ./flags
retrieve the CIA country code
$cia_code = $gcf->cc2cia($country_code)
retrieve the ISO country name
$gci = new Geo::CountryFlags::ISO;
$country_name = $gci->value($country_code);
retrieve the CIA country name
$gcc = new Geo::CountryFlags::CIA;
$country_name = $gcc->value($cia_code);
Provides methods to display / retrieve flag gifs dynamically from the web site of the Central Intelligence Agency. Permanently caches a local copy of the flag gif in your web site sub directory.
The flags for all country codes as of module publication are included in the ./flags directory should you wish to install them. However, If LWP::Simple is installed, Geo::CountryFlags will fetch them as needed and store them in ./flags [default] or the directory of you choice on your web site.
To fetch a single flag PATH the usage is simply:
my $cc = 'US'; # country code
my $flag_path = Geo::CountryFlags->new->get_flag($cc);
for multiple flags:
$gcf = new Geo::CountryFlags;
for (blah.... blah) {
my $cc = function_of(blah...);
my $flag_path = $gcf->get_flag($cc);
....
}
Product's homepage
Requirements:
· Perl