.\" Automatically generated by Pod::Man 4.09 (Pod::Simple 3.35) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .if !\nF .nr F 0 .if \nF>0 \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} .\} .\" ======================================================================== .\" .IX Title "ISIN 3pm" .TH ISIN 3pm "2018-07-08" "perl v5.26.2" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" Business::ISIN \- validate International Securities Identification Numbers .SH "VERSION" .IX Header "VERSION" 0.20 .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 1 \& use Business::ISIN; \& \& my $isin = new Business::ISIN \*(AqUS459056DG91\*(Aq; \& \& if ( $isin\->is_valid ) { \& print "$isin is valid!\en"; \& # or: print $isin\->get() . " is valid!\en"; \& } else { \& print "Invalid ISIN: " . $isin\->error() . "\en"; \& print "The check digit I was expecting is "; \& print Business::ISIN::check_digit(\*(AqUS459056DG9\*(Aq) . "\en"; \& } .Ve .SH "REQUIRES" .IX Header "REQUIRES" Perl5, Locale::Country, Carp .SH "DESCRIPTION" .IX Header "DESCRIPTION" \&\f(CW\*(C`Business::ISIN\*(C'\fR is a class which validates ISINs (International Securities Identification Numbers), the codes which identify shares in much the same way as ISBNs identify books. An \s-1ISIN\s0 consists of two letters, identifying the country of origin of the security according to \s-1ISO 3166,\s0 followed by nine characters in [A\-Z0\-9], followed by a decimal check digit. .PP The \f(CW\*(C`new()\*(C'\fR method constructs a new \s-1ISIN\s0 object. If you give it a scalar argument, it will use the argument to initialize the object's value. Here, no attempt will be made to check that the argument is valid. .PP The \f(CW\*(C`set()\*(C'\fR method sets the \s-1ISIN\s0's value to a scalar argument which you give. Here, no attempt will be made to check that the argument is valid. The method returns the object, to allow you to do things like \&\f(CW\*(C`$isin\->set("GB0004005475")\->is_valid\*(C'\fR. .PP The \f(CW\*(C`get()\*(C'\fR method returns a string, which will be the \s-1ISIN\s0's value if it is syntactically valid, and undef otherwise. Interpolating the object reference in double quotes has the same effect (see the synopsis). .PP The \f(CW\*(C`is_valid()\*(C'\fR method returns true if the object contains a syntactically valid \s-1ISIN.\s0 (Note: this does \fBnot\fR guarantee that a security actually exists which has that \s-1ISIN.\s0) It will return false otherwise. .PP If an object does contain an invalid \s-1ISIN,\s0 then the \f(CW\*(C`error()\*(C'\fR method will return a string explaining what is wrong, like any of the following: .IP "\(bu" 4 \&'xxx' does not start with a 2\-letter country code .IP "\(bu" 4 \&'xxx' does not have characters 3\-11 in [A\-Za\-z0\-9] .IP "\(bu" 4 \&'xxx' character 12 should be a digit .IP "\(bu" 4 \&'xxx' has too many characters .IP "\(bu" 4 \&'xxx' has an inconsistent check digit .PP Otherwise, \f(CW\*(C`error()\*(C'\fR will return \f(CW\*(C`undef\*(C'\fR. .PP \&\f(CW\*(C`check_digit()\*(C'\fR is an ordinary subroutine and \fBnot\fR a class method. It takes a string of the first eleven characters of an \s-1ISIN\s0 as an argument (e.g. \&\*(L"\s-1US459056DG9\*(R"\s0), and returns the corresponding check digit, calculated using the so-called 'double\-add\-double' algorithm. .SH "DIAGNOSTICS" .IX Header "DIAGNOSTICS" \&\f(CW\*(C`check_digit()\*(C'\fR will croak with the message 'Invalid data' if you pass it an unsuitable argument. .SH "ACKNOWLEDGEMENTS" .IX Header "ACKNOWLEDGEMENTS" Thanks to Peter Dintelmann (Peter.Dintelmann@Dresdner\-Bank.com) and Tim Ayers (tim.ayers@reuters.com) for suggestions and help debugging this module. .SH "AUTHOR" .IX Header "AUTHOR" David Chan .SH "COPYRIGHT" .IX Header "COPYRIGHT" Copyright (C) 2002, David Chan. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.