BarcodeID is a Perl module to perform simple identification and validation on UPC-A, UPC-E, EAN-8, EAN-13, CODE39 barcodes.
When passing the barcode you should omit the check digit, so for a UPCA you should only be passing 11 digits, for a UPCE you should just be passing 6, EAN-8 should be 7 EAN-13 should be 12, the only difference in CODE39 which is variable length and as such the only checking performed here is that is doesn't contain invalid characters.
You can just pass in a barcode and identify it or you can pass in a barcode and a type and validate it.
SYNOPSIS
use BarcodeID qw/validate identify barcode type/;
my $id = BarcodeID->new('barcode' => '012345');
print $id->barcode();
$id->identify();
print $id->type();
if($id->validate())
{
print "Invalid barcode";
}
#### OR
my $id = BarcodeID->new('barcode' => '012345', 'type' => 'UPCE');
if($id->validate())
{
print "Invalid barcode";
}
Product's homepage
Requirements:
· Perl