Skip Menu |

This queue is for tickets about the Business-CUSIP CPAN distribution.

Report information
The Basics
Id: 4999
Status: resolved
Worked: 15 min
Priority: 0/
Queue: Business-CUSIP

People
Owner: tim [...] quaday.com
Requestors: gfaulk [...] advisorsoftware.com
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: (no value)
Fixed in: (no value)



Subject: False positive error thrown by is_valid() method
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
RT-Send-CC: tayers [...] quaday.com
Check Point's website is incorrectly, or at least ambiguously, claiming M22465104 is a CUSIP. It's really a CINS, a CUSIP International Number System number, which happens to be a CUSIP (without check digit) 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"; } __END__ See http://www.cusip.com/NASApp/cusipweb/com/sp/apps/cusipaccess/html/whats.html#int for more information about CINS's versus CUSIPs. Hope you have a very nice day, :-) tim
Date: Fri, 23 Jan 2004 12:17:35 -0700
From: Tim Ayers <tayers [...] quaday.com>
To: bug-Business-CUSIP [...] rt.cpan.org
Subject: Re: [cpan #4999] False positive error thrown by is_valid() method
RT-Send-Cc:
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 > >