Subject: | $isbn13->as_string([]) strips off checksum |
Perhaps I do not understand how this is supposed to work,
but I'd guess it should not work like this.
#!/usr/bin/env perl
use strict;
use warnings;
use Data::Dumper;
use lib qw{ local/lib/perl5 };
use Business::ISBN;
print 'version: ' . $Business::ISBN::VERSION . "\n";
my $isbn_raw = '0-688-08510-5';
my $isbn_obj = Business::ISBN->new( $isbn_raw );
my $isbn13 = $isbn_obj->as_isbn13;
# ->as_string( [] )->fix_checksum;
print Dumper( $isbn_obj, $isbn13, $isbn13->as_string([]) );
exit;
yields --
$ perl test.pl
version: 2.07
$VAR1 = bless( {
'common_data' => '0688085105',
'publisher_code' => '688',
'group_code' => '0',
'input_isbn' => '0-688-08510-5',
'valid' => 1,
'checksum' => '5',
'type' => 'ISBN10',
'isbn' => '0688085105',
'article_code' => '08510',
'prefix' => ''
}, 'Business::ISBN10' );
$VAR2 = bless( {
'common_data' => '9780688085105',
'publisher_code' => '688',
'group_code' => '0',
'input_isbn' => '9780688085105',
'valid' => 1,
'checksum' => 0,
'type' => 'ISBN13',
'isbn' => '9780688085100',
'article_code' => '08510',
'prefix' => '978'
}, 'Business::ISBN13' );
$VAR3 = '9780688085100';
I was expecting to see: '9780688085105', instead.
-- Hugh Esco