NAME

MooseX::Types::GTIN - Moose types for Global Trade Identifiers.

SYNOPSIS

use MooseX::Types::GTIN qw/ GTIN ISBN10 /;

is_GTIN(829410333658); # returns true
to_GTIN("  829410333658 "); # returns 829410333658

is_ISBN10(0974514055); # returns true
to_GTIN(0974514055); # returns 9780974514055

use Moose;
has barcode => ( is => "rw", isa => GTIN );
has isbn =>    ( is => "rw", isa => ISBN10 );

DESCRIPTION

This package provides Moose types for "Global Trade Identifiers, also known as UPCs and EANs. 8, 12, 13 and 14 digital varients of GTINs are supported, along with 10 digit ISBN numbers. The checksum of GTINs are validated, ISBN numbers are only checked for the correct form.

SEE ALSO

AUTHOR