Daniel Culver
and 1 contributors

NAME

Locale::Country::OFAC - Module to look up OFAC Sanctioned Countries

SYNOPSIS

    use strict;
    use warnings;
    use Locale::Country::OFAC qw( get_sanction_by_code is_region_sanctioned is_division_sanctioned );

    my $is_sanctioned = get_sanction_by_code( 'IR' );         # Country Code
    my $is_sanctioned = is_region_sanctioned( 'UK', 95000 );  # Country Code, Zip Code
    my $is_sanctioned = is_division_sanctioned( 'UK', '43' ); # Country Code, SubCountry/Division Code

DESCRIPTION

Module to lookup if a country is OFAC Sanctioned.

OFAC Source: <<L http://www.treasury.gov/resource-center/sanctions/Programs/Pages/Programs.aspx >>

METHODS

get_sanction_by_code

    use Locale::Country::OFAC qw( get_sanction_by_code );

    my $iran = 'IR';

    if ( get_sanction_by_code($iran) ) {
        print "Sorry, can't do business- country is Sanctioned\n";
    }

Returns 1 if the country is sanctioned, 0 if not. It also accepts lower case and 3 letter country codes.

is_region_sanctioned

    use Locale::Country::OFAC qw( is_region_sanctioned );

    my $russia = 'RU';
    my $zip    = 95001;

    if ( is_region_sanctioned( $russia, $zip ) ) {
        print "region is sanctioned \n";
    }

This method takes a country code and zip code. It returns 1 if it is sanctioned and 0 if not.

CAVEATS AND LIMITATIONS

Russian and Ukranian country codes are in this module's lookup table, but only certain zip codes of them are currently OFAC sanctioned. This is the reasoning for creating the is_region_sanctioned method.

is_division_sanctioned

    use Locale::Country::OFAC qw( is_division_sanctioned );

    my $ukraine = 'UA';
    my $crimea  = '43'; # ISO-3166-2 for Crimera

    if ( is_division_sanctioned( $ukraine, $crimea ) ) {
        print "division is sanctioned \n";
    }

This method takes a country and subcountry code. It returnes 1 if the provided combination is sanctioned and 0 if not.

CAVEATS AND LIMITATIONS

All of Crimea is considered sanctioned (when searching for ISO-3166-2:UA 43 ).

AUTHOR

Daniel Culver, perlsufi@cpan.org

THANKS TO

Robert Stone, drzigman@cpan.org

Doug Schrag

Eris Caffee

HostGator

COPYRIGHT

This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself.