line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Locale::Country::OFAC; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
1230724
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
28
|
|
4
|
1
|
|
|
1
|
|
5
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
21
|
|
5
|
|
|
|
|
|
|
|
6
|
1
|
|
|
1
|
|
4
|
use Exporter; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
25
|
|
7
|
1
|
|
|
1
|
|
6
|
use Carp; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
234
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
our @ISA = qw(Exporter); |
10
|
|
|
|
|
|
|
our @EXPORT_OK = qw(get_sanction_by_code); |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
our $VERSION = '0.1.0'; # VERSION |
13
|
|
|
|
|
|
|
# ABSTRACT: Module to look up OFAC Sanctioned Countries |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
=pod |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
=encoding utf8 |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
=head1 NAME |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
Locale::Country::OFAC - Module to look up OFAC Sanctioned Countries |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
=head1 SYNOPSIS |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
use strict; |
26
|
|
|
|
|
|
|
use warnings; |
27
|
|
|
|
|
|
|
use Locale::Country; |
28
|
|
|
|
|
|
|
use Locale::Country::OFAC qw( get_sanction_by_code ); |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
my $cuba = country2code('cuba'); |
31
|
|
|
|
|
|
|
get_sanction_by_code($cuba); |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
=head1 DESCRIPTION |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
Module to lookup if a country is OFAC Sanctioned. |
36
|
|
|
|
|
|
|
Takes a country code and returns a true value if it is. |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
=head1 METHODS |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
=head2 get_sanction_by_code |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
my $iran = 'IR'; |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
if (get_sanction_by_code($iran) ) { |
45
|
|
|
|
|
|
|
print "Sorry, can't do business- country is Sanctioned\n"; |
46
|
|
|
|
|
|
|
} |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
Returns 1 if the country is sanctioned, 0 if not. |
49
|
|
|
|
|
|
|
It also accepts lower case and 3 letter country codes. |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
=head1 AUTHOR |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
Daniel 'The Man' Culver |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
=head1 THANKS TO |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
Robert Stone, C<< drzigman@cpan.org >> |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
Eris Caffee |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
HostGator |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
PerlMonks, L<< http://www.perlmonks.com >> |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
=head1 COPYRIGHT |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
=cut |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
our %sanctioned_country_codes = |
74
|
|
|
|
|
|
|
map { $_ => 1 } qw( MMR MM IRN IR CUB CU SSD SD PRK KP SYR SY ); |
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
sub get_sanction_by_code { |
77
|
8
|
|
66
|
8
|
1
|
593
|
my $country_code = shift || croak "get_sanction_by_code requires country code"; |
78
|
7
|
100
|
|
|
|
44
|
return exists $sanctioned_country_codes{ uc $country_code } ? 1 : 0; |
79
|
|
|
|
|
|
|
} |
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
1; |