#!/usr/bin/env perl

use strict;
use warnings;

use C4::Biblio  qw( AddBiblio );
use C4::Context ();

use Koha::Biblios  ();
use Koha::Database ();

use Carp         qw( carp );
use Data::Dumper qw( Dumper );
use MARC::Record ();

my $schema = Koha::Database->new->schema;

$schema->storage->txn_begin;

my ($biblionumber) = AddBiblio( MARC::Record->new, q{}, { skip_record_index => 1 } );
if ($biblionumber) {
    my $biblio = Koha::Biblios->find($biblionumber);
    if ($biblio) {
        carp Dumper $biblio;
    } else {
        carp 'No biblio';
    }

} else {
    carp 'No biblionumber';
}

$schema->storage->txn_commit;

1;
