Check Point's website is incorrectly or at least ambiguously calling the
identifer a CUSIP. M22465104, is really a CINS number. A CINS is a
CUSIP International Number. A CINS also happens to be the CUSIP with a
country code stuck on the front. Try this code....
use Business::CUSIP;
use Business::CINS;
my $cns = Business::CINS->new('M22465104');
if ($cns->is_valid()) {
print $cns->cins, " is a valid CINS\n";
} else {
print $Business::CINS::ERROR, "\n";
}
my $csp = Business::CUSIP->new('22465104');
$csp->cusip($csp->cusip().$csp->check_digit());
if ( $csp->is_valid() ) {
print $csp->cusip, " is a valid CUSIP\n";
} else {
print $Business::CUSIP::ERROR , "\n";
}
See
http://www.cusip.com/NASApp/cusipweb/com/sp/apps/cusipaccess/html/whats.html#int
for more information about CINS.
HTH and
Hope you have a very nice day, :-)
Tim Ayers
Guest via RT wrote:
Show quoted text> This message about Business-CUSIP was sent to you by guest <> via rt.cpan.org
>
> Full context and any attached attachments can be found at:
> <URL:
https://rt.cpan.org/Ticket/Display.html?id=4999 >
>
> Method is_valid() is reporting that cusip's are invalid when in fact they are OK. The following code fragment reproduces the problem.
>
> #
> # Cusip M22465104 belongs to Check Point software and is a valid
> # cusip. You can verify that here:
> #
> #
http://www.checkpoint.com/corporate/ir/faq-stock.html
> #
> use Business::CUSIP;
> my $csp = Business::CUSIP->new('M22465104');
> unless ( $csp->is_valid() ) {
> print $Business::CUSIP::ERROR , "\n";
> }
> #===========================================
> This is perl, v5.8.2 built for MSWin32-x86-multi-thread
> (with 25 registered patches, see perl -V for more detail)
>
> Copyright 1987-2003, Larry Wall
>
> Binary build 808 provided by ActiveState Corp.
http://www.ActiveState.com
> ActiveState is a division of Sophos.
> Built Dec 9 2003 10:19:40
>
> Windows XP SP1 Build 2600
>
>