Locale::Country::OFAC - Module to look up OFAC Sanctioned Countries
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
Module to lookup if a country is OFAC Sanctioned.
OFAC Source: <<L http://www.treasury.gov/resource-center/sanctions/Programs/Pages/Programs.aspx >>
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.
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.
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.
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.
All of Crimea is considered sanctioned (when searching for ISO-3166-2:UA 43 ).
Daniel Culver, perlsufi@cpan.org
perlsufi@cpan.org
Robert Stone, drzigman@cpan.org
drzigman@cpan.org
Doug Schrag
Eris Caffee
HostGator
This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install Locale::Country::OFAC, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Locale::Country::OFAC
CPAN shell
perl -MCPAN -e shell install Locale::Country::OFAC
For more information on module installation, please visit the detailed CPAN module installation guide.