The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

App::ISBN::Check - Base class for isbn-check script.

SYNOPSIS

 use App::ISBN::Check;

 my $app = App::ISBN::Check->new;
 my $exit_code = $app->run;

METHODS

new

 my $app = App::ISBN::Check->new;

Constructor.

run

 my $exit_code = $app->run;

Run.

Returns 1 for error, 0 for success.

ERRORS

 new():
         From Class::Utils::set_params():
                 Unknown parameter '%s'.

EXAMPLE1

 use strict;
 use warnings;

 use App::ISBN::Check;
 use File::Temp;
 use IO::Barf qw(barf);

 # ISBNs for test.
 my $isbns = <<'END';
 978-80-253-4336-4
 9788025343363
 9788025343364
 978802534336
 9656123456
 END

 # Temporary file.
 my $temp_file = File::Temp->new->filename;

 # Barf out.
 barf($temp_file, $isbns);

 # Arguments.
 @ARGV = (
         $temp_file,
 );

 # Run.
 exit App::ISBN::Check->new->run;

 # Output:
 # 9788025343363: Different after format (978-80-253-4336-4).
 # 9788025343364: Different after format (978-80-253-4336-4).
 # 978802534336: Cannot parse.
 # 9656123456: Not valid.

EXAMPLE2

 use strict;
 use warnings;

 use App::ISBN::Check;

 # Arguments.
 @ARGV = (
         -h,
 );

 # Run.
 exit App::ISBN::Check->new->run;

 # Output:
 # Usage: ./print_help.pl [-h] [--version] file_with_isbns
 #         -h              Print help.
 #         --version       Print version.
 #         file_with_isbns File with ISBN strings, one per line.

DEPENDENCIES

Business::ISBN, Class::Utils, Error::Pure, Getopt::Std, Perl6::Slurp.

REPOSITORY

https://github.com/michal-josef-spacek/App-ISBN-Check

AUTHOR

Michal Josef Špaček mailto:skim@cpan.org

http://skim.cz

LICENSE AND COPYRIGHT

© 2024 Michal Josef Špaček

BSD 2-Clause License

VERSION

0.01