Data-OFAC
view release on metacpan or search on metacpan
lib/Data/OFAC.pm view on Meta::CPAN
package Data::OFAC;
use 5.006;
use strict;
use warnings;
use Data::OFAC::SDN;
=head1 NAME
Data::OFAC - A Perl interface to the United States Office of Foreign Assets
Control (OFAC) Specially Designated Nationals List (SDN)
=head1 VERSION
Version 0.80
=cut
our $VERSION = '0.80';
=head1 DESCRIPTION
From OFAC's Website:
As part of its enforcement efforts, OFAC publishes a list of
individuals and companies owned or controlled by, or acting for or on
behalf of, targeted countries. It also lists individuals, groups, and
entities, such as terrorists and narcotics traffickers designated under
programs that are not country-specific. Collectively, such individuals
and companies are called "Specially Designated Nationals" or "SDNs."
Their assets are blocked and U.S. persons are generally prohibited from
dealing with them.
This interface is helpful for insitutions that use Perl, and may have a
need to screen individuals as potential customers.
Note that this module will require occasional internet access if
auto_update is enabled. Auto update contacts OFAC's website to download
the latest SDN list in "CSV" format. These files are used to build a SQLite
database. In order to remain "compliant" reasonably frequent updates are
recommended. For financial institutions, not complying with this carries
heavy penalties. I am not a lawyer, and I cannot recommend your update
frequency. I've set 12 hours as I believe this to be a reasonable update
interval. Again, this module carries no waranty, and cannot be a full
replacement for full compliance with the regulations. YMMV.
=head1 SYNOPSIS
A simple example.
use Data::OFAC;
my $ofac = Data::OFAC->new(
auto_update => 1,
auto_update_frequency => 12,
database_file => '/path/to/sdn.sqlite'
);
my $result = $ofac->checkString($string);
if ( defined $result ) {
print "Hit found:" .
Dumper $result; # varries by hit, but is just a hash.
}
...
=head1 SUBROUTINES/METHODS
=head2 new
Instantiates the base object. Note that the following parameters are
currently supported:
=head3 auto_update [0,1] (Optional)
Tells Data::OFAC whether you desire to update the database. It will check a
table in SQLite to determine the last update date/time and decide if
checking for a new update is warranted. Note that the download is not
particularly large, but the download and subsequent rebuild of the database
could introduce a startup penalty that may be undesirable. (30 seconds on my
quad core MBP) For long running processes, there is no present method for
updating on the fly. Since I run this as part of a larger web service, my
processes cycle frequently enough that I never have this problem. YMMV
0 - disable
1 - enable *default
=head3 auto_update_frequency [int] (Optional)
Sets the desired delay between rechecks. Data::OFAC will recheck at each
start if the auto_update property is set to 1.
( run in 0.503 second using v1.01-cache-2.11-cpan-e1769b4cff6 )