Přeskočit na obsah

Projekt: Hesla Jednoty bratrské/ISBN/perl

Z Wikiverzity

Perlovský skript na generování ISBN a EAN pro Projekt: Hesla Jednoty bratrské

Existuje několik knihoven Perlu pro operace s ISBN.

#! /usr/bin/perl -w
# sudo cpan Algorithm::CheckDigits
use strict;
use Algorithm::CheckDigits;

sub icompl {
    my ($year, $isbnstr, $comment) = @_;
    my $isbn13 = CheckDigits('isbn13');
    my $icn = $isbn13->complete($isbnstr);
    my $eanstr = $isbnstr;
    $eanstr =~ s/-//g;
    my $ean = CheckDigits('ean');
    my $ecn = $ean->complete($eanstr);
    print "*Hesla JB na rok $year: ISBN $icn  EAN $ecn ($comment)\n";
}

icompl (2008, '978-80-902899-8-', '');
icompl (2009, '978-80-902899-9-', '');

icompl (2010, '978-80-904123-0-', '');
icompl (2011, '978-80-904123-1-', '');
icompl (2012, '978-80-904123-2-', '');
icompl (2013, '978-80-904123-3-', '');
icompl (2014, '978-80-904123-4-', 'brož. V2');
icompl (2014, '978-80-904123-5-', 'váz. V4');
icompl (2015, '978-80-904123-6-', 'brož. V2');
icompl (2015, '978-80-904123-7-', 'váz. V4');
icompl (2016, '978-80-904123-8-', 'brož. V2');
icompl (2016, '978-80-904123-9-', 'váz. V4');

icompl (2017, '978-80-88199-00-', 'brož. V2');
icompl (2017, '978-80-88199-01-', 'váz. V4');
icompl (2018, '978-80-88199-02-', 'brož. V2');
icompl (2018, '978-80-88199-03-', 'váz. V4');
icompl (2019, '978-80-88199-04-', 'brož. V2');
icompl (2019, '978-80-88199-05-', 'váz. V4');
icompl (0000, '978-80-88199-06-', 'brož. V2');
icompl (0000, '978-80-88199-07-', 'váz. V4');
icompl (0000, '978-80-88199-08-', 'brož. V2');
icompl (0000, '978-80-88199-09-', 'váz. V4');
icompl (0000, '978-80-88199-10-', 'brož. V2');
icompl (2021, '978-80-88199-11-', 'brož. V2');
icompl (2021, '978-80-88199-12-', 'váz. V4');
icompl (2021, '978-80-88199-13-', 'ebook PDF');
icompl (2022, '978-80-88199-14-', 'brož. V2');
icompl (2022, '978-80-88199-15-', 'váz. V4');
icompl (2022, '978-80-88199-16-', 'ebook PDF');
icompl (0000, '978-80-88199-17-', 'váz. V4');
icompl (0000, '978-80-88199-18-', 'brož. V2');
icompl (0000, '978-80-88199-19-', 'váz. V4');
icompl (0000, '978-80-88199-20-', 'brož. V2');
icompl (0000, '978-80-88199-21-', 'váz. V4');
icompl (0000, '978-80-88199-22-', 'brož. V2');
icompl (0000, '978-80-88199-23-', 'váz. V4');
icompl (0000, '978-80-88199-24-', 'brož. V2');
icompl (0000, '978-80-88199-25-', 'váz. V4');
icompl (0000, '978-80-88199-26-', 'brož. V2');
icompl (0000, '978-80-88199-27-', 'váz. V4');