App-NKC2MARC
view release on metacpan or search on metacpan
NKC2MARC.pm view on Meta::CPAN
use English;
use Error::Pure qw(err);
use Getopt::Std;
use IO::Barf qw(barf);
use List::Util 1.33 qw(none);
use MARC::File::XML;
use MARC::Record;
use Readonly;
use ZOOM;
Readonly::Array our @OUTPUT_FORMATS => qw(usmarc xml);
our $VERSION = 0.03;
$| = 1;
# Constructor.
sub new {
my ($class, @params) = @_;
# Create object.
NKC2MARC.pm view on Meta::CPAN
print STDERR "Usage: $0 [-h] [-o output_format] [--version] id_of_book ..\n";
print STDERR "\t-h\t\t\tPrint help.\n";
print STDERR "\t-o output_format\tOutput format (usmarc, xml - default).\n";
print STDERR "\t--version\t\tPrint version.\n";
print STDERR "\tid_of_book ..\t\tIdentifier of book e.g. Czech ".
"national bibliography id or ISBN\n";
return 1;
}
my @book_ids = @ARGV;
if (none { $self->{'_opts'}->{'o'} eq $_ } @OUTPUT_FORMATS) {
err 'Bad output format.',
'Output format', $self->{'_opts'}->{'o'},
;
}
# Configuration of National library of the Czech Republic service.
my $c = {
host => 'aleph.nkp.cz',
port => '9991',
database => 'NKC01',
( run in 0.417 second using v1.01-cache-2.11-cpan-4e96b696675 )