SeeAlso::Identifier::ISBN - International Standard Book Number as Identifier
version 0.71
my $isbn = new SeeAlso::Identifier::ISBN ""; print "invalid" unless $isbn; # $isbn is defined but false ! $isbn->value( '0-8044-2957-x' ); $isbn->value; # '' or ISBN-13 without hyphens (9780804429573) $isbn; # ISBN-13 as URI (urn:isbn:9780804429573) $isbn->hash; # long int between 0 and 1999999999 (or '') $isbn->hash( 59652724 ); # set by hash $isbn->canonical; # urn:isbn:9780596527242
This module handles International Standard Book Numbers as identifiers. Unlike Business::ISBN the constructor of SeeAlso::Identifier::ISBN always returns an defined identifier with all methods provided by SeeAlso::Identifier. As canonical form the URN representation of ISBN-13 without hyphens is used - that means all ISBN-10 are converted to ISBN-13. As hashed form of an ISBN, a 32 Bit integer can be calculated.
Get and/or set the value of the ISBN. Returns an empty string or the valid ISBN-13 without hyphens as determinded by Business::ISBN. You can also use this method as function.
Returns a Uniform Resource Identifier (URI) for this ISBN (or an empty string).
This is an URI according to RFC 3187 ("urn:isbn:..."). Unfortunately RFC 3187 is broken, because it does not oblige normalization - this method does: first only valid ISBN (with valid checkdigit) are allowed, second all ISBN are converted to ISBN-13 notation without hyphens (URIs without defined normalization and valitidy check are pointless).
Returns or sets a space-efficient representation of the ISBN as long integer. An ISBN-13 always starts with '978' or '979' and ends with a check digit. This makes 2,000,000,000 possible ISBN which fits in a 32 bit (signed or unsigned) integer value. The integer value is calculated from the ISBN-13 by removing the check digit and subtracting 978,000,000,000.
Return the ISBN in ISBN 13 form (or an empty string)
Return the ISBN in ISBN 10 form if possible (or an empty string)
In theory zero ('0') is a valid ISBN value representing ISBN-10 0-00-000000-0 = ISBN-13 978-0-00-000000-2. In practise this value is mostly used errorously.
For canonical form instead of RFC 3187 you could also use "http://purl.org/isbn/".
Jakob Voss
This software is copyright (c) 2013 by Jakob Voss.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install SeeAlso::Server, copy and paste the appropriate command in to your terminal.
cpanm
cpanm SeeAlso::Server
CPAN shell
perl -MCPAN -e shell install SeeAlso::Server
For more information on module installation, please visit the detailed CPAN module installation guide.