Matthew Green
and 1 contributors

NAME

Locale::Country::EU

VERSION

version 0.004

SYNOPSIS

  use Locale::Country::EU;

  my $array = list_eu_countries({
    include_efta => 1,
    exclude => ['GB']
  });


  my $boolean = is_eu_country({
    country => $array->[0]->{'ISO-name'}
  });

DESCRIPTION

Locale::Country::EU - Perl extension for determining if a country is within the European Union based on the following ISO data.

    'ISO-name'   => 'Germany',
    'ISO-m49'    => '276',
    'ISO-alpha3' => 'DEU',
    'ISO-alpha2' => 'DE',

This Module also allows for list customization with additional helper arguments. These are handy in cases like GDPR where certain conditions can cause the list data to change.

EXPORT

    is_eu_country
    list_eu_countries
    $ISO_CODES
    $EU_COUNTRY_MAP

AUTHOR

mgreen, <matt@mattsizzle.com>

METHODS

is_eu_country ()

Returns where a country is within the European Union (EU) based on the agruments passed to the method. The return will be truthy when the country is located within the European Union and falsy if it was not determined to be in the EU.

Note agruments are passed into the method within a single hash of key value pairs.

ARGUMENTS

country: STRING

The country to be checked for inclusion in the European Union (EU). This value can be any of the following:

    ISO-name    ex. Germany
    ISO-m49     ex. 276
    ISO-alpha3  ex. DEU
    ISO-alpha2  ex. DE

NOTE: You do not have to specific the ISO type being provided for flexiblity as it will cycle through each value automatically to find a match.

include_efta: 1

Modifies the European Union (EU) DataSet to include the European Free Trade Association (EFTA) countries. While not part of the "full" EU these additional countries can have EU laws or restrictions applied. Such as the case with GDPR.

exclude: ARRARY[STR,]

Allows the caller to modify the European Union (EU) DataSet so that certain countries are excluded. Each value in the passed array is checked against all ISO types in the DataSet.

NOTE: You do not have to specific the ISO type being provided for flexiblity as it will cycle through each value automatically to find a match.

list_eu_countries ()

Returns a DataSet of countries in the European Union (EU) based on the agruments passed.

Note agruments are passed into the method within a single hash of key value pairs.

ARGUMENTS

iso_code: STRING

When passed and a valid ISO type is provided this method will return an ARRAY[STR,] where each STR is the requested ISO code for each country.

    ISO-name    ex. Germany
    ISO-m49     ex. 276
    ISO-alpha3  ex. DEU
    ISO-alpha2  ex. DE

NOTE: You do not have to specific the ISO code agrument. If it is not supplied the unmodified EU country DataSet is returned

include_efta: 1

Modifies the European Union (EU) DataSet to include the European Free Trade Association (EFTA) countries. While not part of the "full" EU these additional countries can have EU laws or restrictions applied. Such as the case with GDPR.

exclude: ARRARY[STR,]

Allows the caller to modify the European Union (EU) DataSet so that certain countries are excluded. Each value in the passed array is checked against all ISO types in the DataSet.

NOTE: You do not have to specific the ISO type being provided for flexiblity as it will cycle through each value automatically to find a match.

COPYRIGHT AND LICENSE

Copyright (C) 2018 by Matthew Green <matt@mattsizzle.com>

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.16.3 or, at your option, any later version of Perl 5 you may have available.