Business::ISSN(3pm) | User Contributed Perl Documentation | Business::ISSN(3pm) |
Business::ISSN - Perl extension for International Standard Serial Numbers
use Business::ISSN; $issn_object = Business::ISSN->new('1456-5935'); $issn_object = Business::ISSN->new('14565935'); # print the ISSN (with hyphen) print $issn_object->as_string; # check to see if the ISSN is valid $issn_object->is_valid; #fix the ISSN checksum. BEWARE: the error might not be #in the checksum! $issn_object->fix_checksum; #EXPORTABLE FUNCTIONS use Business::ISSN qw( is_valid_checksum ); #verify the checksum if( is_valid_checksum('01234567') ) { ... }
The string representing the ISSN may contain characters other than [0-9xX], although these will be removed in the internal representation. The resulting string must look like an ISSN - the first seven characters must be digits and the eighth character must be a digit, 'x', or 'X'.
The string passed as the ISSN need not be a valid ISSN as long as it superficially looks like one. This allows one to use the "fix_checksum" method.
One should check the validity of the ISSN with "is_valid()" rather than relying on the return value of the constructor.
If all one wants to do is check the validity of an ISSN, one can skip the object-oriented interface and use the c<is_valid_checksum()> function which is exportable on demand.
If the constructor decides it can't create an object, it returns undef. It may do this if the string passed as the ISSN can't be munged to the internal format.
A terminating 'x' is changed to 'X'.
Returns 0 if the ISSN does not pass the checksum test. The constructor accepts invalid ISSN's so that they might be fixed with "fix_checksum".
Some functions can be used without the object interface. These do not use object technology behind the scenes.
Currently maintained by brian d foy "<brian.d.foy@gmail.com>".
Original module by Sami Poikonen, based on Business::ISBN by brian d foy.
This module is released under the terms of the Perl Artistic License.
Copyright © 1999-2021, brian d foy <bdfoy@cpan.org>. All rights reserved.
You may redistribute this under the terms of the Artistic License 2.0.
2022-10-13 | perl v5.34.0 |