NAME

Business::CUSIP - Verify Committee on Uniform Security Identification Procedures Numbers

SYNOPSIS

use Business::CUSIP;
$csp = Business::CUSIP->new('035231AH2');
print "Looks good.\n" if $csp->is_valid;

$csp = Business::CUSIP->new('392690QT', 1);
$chk = $csp->check_digit;
$csp->cusip($csp->cusip.$chk);
print $csp->is_valid ? "Looks good." : "Invalid: ", $Business::CUSIP::ERROR, "\n";

DESCRIPTION

This module helps verify CUSIPs, which are financial security identifiers issued by the Standard & Poor's Company. This module cannot tell if a CUSIP references a real security, but it can tell you if the given CUSIP is properly formatted.

METHODS

new([CUSIP_NUMBER[, IS_FIXED_INCOME]])

The new constructor takes to optional arguments: the CUSIP number and a Boolean value signifying whether this CUSIP refers to a fixed income security. CUSIPs for fixed income securities are validated a little differently than other CUSIPs.

cusip([CUSIP_NUMBER])

If no argument is given to this method, it will return the current CUSIP number. If an argument is provided, it will set the CUSIP number and then return the CUSIP number.

is_fixed_income([TRUE_OR_FALSE])

If no argument is given to this method, it will return whether the CUSIP object is marked as a fixed income security. If an argument is provided, it will set the fixed income property and then return the fixed income setting.

is_valid()

Returns true if the checksum of the CUSIP is correct otherwise it returns false and $Business::CUSIP::ERROR will contain a description of the problem.

check_digit()

This method returns the checksum of the given object. If the CUSIP number of the object contains a check_digit, it is ignored. In other words this method recalculates the check_digit each time.

CAVEATS

This module uses the Algorithm::LUHN module and it adds characters to the valid_chars map of Algorithm::LUHN. So if you rely on the default valid map in the same program you use Business::CUSIP you might be surprised.

AUTHOR

This module was written by Tim Ayers (http://search.cpan.org/search?author=TAYERS).

COPYRIGHT

Copyright (c) 2001 Tim Ayers. All rights reserved.

LICENSE

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

1 POD Error

The following errors were encountered while parsing the POD:

Around line 147:

You forgot a '=back' before '=head1'