The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

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 );

    my $sanction = get_sanction_by_code('IR');

DESCRIPTION

Module to lookup if a country is OFAC Sanctioned. Takes a country code and returns a true value if it is.

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

METHODS

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.

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.