NAME

Data::MARC::Field008::Book - Data object for MARC field 008 book material.

SYNOPSIS

use Data::MARC::Field008::Book;

my $obj = Data::MARC::Field008::Book->new(%params);
my $biography = $obj->biography;
my $conference_publication = $obj->conference_publication;
my $festschrift = $obj->festschrift;
my $form_of_item = $obj->form_of_item;
my $government_publication = $obj->government_publication;
my $illustrations = $obj->illustrations;
my $index = $obj->index;
my $literary_form = $obj->literary_form;
my $nature_of_content = $obj->nature_of_content;
my $raw = $obj->raw;
my $target_audience = $obj->target_audience;

METHODS

new

my $obj = Data::MARC::Field008::Book->new(%params);

Constructor.

  • biography

    Biography. The length of the item is 1 character. Possible characters are ' ', 'a', 'b', 'c', 'd' or '|'.

    It's required.

    Default value is undef.

  • conference_publication

    Conference publication. The length of the item is 1 character. Possible characters are '0', '1' or '|'.

    It's required.

    Default value is undef.

  • festschrift

    Festschrift. The length of the item is 1 character. Possible characters are '0', '1' or '|'.

    It's required.

    Default value is undef.

  • form_of_item

    Form of item. The length of the item is 1 character. Possible characters are ' ', 'a', 'b', 'c', 'd', 'f', 'o', 'q', 'r', 's' or '|'.

    It's required.

    Default value is undef.

  • government_publication

    Government publication. The length of the string is 1 character. Possible characters are ' ', 'a', 'c', 'f', 'i', 'l', 'm', 'o', 's', 'u', 'z' or '|'.

    It's required.

    Default value is undef.

  • illustrations

    Illustrations. The length of the string is 4 characters. Possible characters are ' ', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'o', 'p' or '|'.

    It's required.

    Default value is undef.

  • index

    Index. The length of the string is 1 character. Possible characters are '0', '1' or '|'.

    It's required.

    Default value is undef.

  • literary_form

    Literary form. The length of the string is 1 character. Possible characters are '0', '1', 'd', 'e', 'f', 'h', 'i', 'j', 'm', 'p', 's', 'u' or '|'.

    It's required.

    Default value is undef.

  • nature_of_content

    Nature of contents. The length of the string is 4 characters. Possible characters are ' ', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'y', 'z', '2', '5', '6' or '|'.

    It's required.

    Default value is undef.

  • raw

    Raw string of material. The length of the string is 17 characters.

    It's optional.

    Default value is undef.

  • target_audience

    Target audience. The length of the item is 1 character. Possible characters are ' ', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'j' or '|'.

    It's required.

    Default value is undef.

Returns instance of object.

biography

my $biography = $obj->biography;

Get biography.

Returns string.

conference_publication

my $conference_publication = $obj->conference_publication;

Get conference publication.

Returns string.

festschrift

my $festschrift = $obj->festschrift;

Get festschrift.

Returns string.

form_of_item

my $form_of_item = $obj->form_of_item;

Get form of item.

Returns string.

government_publication

my $government_publication = $obj->government_publication;

Get government publication.

Returns string.

illustrations

my $illustrations = $obj->illustrations;

Get illustrations.

Returns string.

index

my $index = $obj->index;

Get index.

Returns string.

literary_form

my $literary_form = $obj->literary_form;

Get literary form.

Returns string.

nature_of_content

my $nature_of_content = $obj->nature_of_content;

Get nature of content.

Returns string.

raw

my $raw = $obj->raw;

Get raw string of the block.

Returns string.

target_audience

my $target_audience = $obj->target_audience;

Get target audience.

Returns string.

ERRORS

new():
        Couldn't create data object of book.
                Raw string: %s
        Parameter 'raw' has length different than '17'.
                Value: %s
        From Data::MARC::Field008::Utils::check_book_biography():
                Parameter 'biography' has bad value.
                        Value: %s
                Parameter 'biography' is required.
                Parameter 'biography' length is bad.
                        Length: %s
                        Value: %s
                        Expected length: 1
                Parameter 'biography' must be a scalar value.
                        Reference: %s
        From Data::MARC::Field008::Utils::check_book_festschrift():
                Parameter 'festschrift' has bad value.
                        Value: %s
                Parameter 'festschrift' is required.
                Parameter 'festschrift' length is bad.
                        Length: %s
                        Value: %s
                        Expected length: 1
                Parameter 'festschrift' must be a scalar value.
                        Reference: %s
        From Data::MARC::Field008::Utils::check_book_illustration():
                Parameter 'illustrations' contains bad book illustration character.
                        Value: %s
                Parameter 'illustrations' has value with pipe character.
                        Value: %s
                Parameter 'illustrations' is required.
                Parameter 'illustrations' length is bad.
                        Length: %s
                        Value: %s
                        Expected length: 4
                Parameter 'illustrations' must be a scalar value.
                        Reference: %s
        From Data::MARC::Field008::Utils::check_book_literary_form():
                Parameter 'literary_form' has bad value.
                        Value: %s
                Parameter 'literary_form' is required.
                Parameter 'literary_form' length is bad.
                        Length: %s
                        Value: %s
                        Expected length: 1
                Parameter 'literary_form' must be a scalar value.
                        Reference: %s
        From Data::MARC::Field008::Utils::check_book_nature_of_content():
                Parameter 'nature_of_content' has bad value.
                        Value: %s
                Parameter 'nature_of_content' has value with pipe character.
                        Value: %s
                Parameter 'nature_of_content' is required.
                Parameter 'nature_of_content' length is bad.
                        Length: %s
                        Value: %s
                        Expected length: 4
                Parameter 'nature_of_content' must be a scalar value.
                        Reference: %s
        From Data::MARC::Field008::Utils::check_conference_publication():
                Parameter 'conference_publication' has bad value.
                        Value: %s
                Parameter 'conference_publication' is required.
                Parameter 'conference_publication' length is bad.
                        Length: %s
                        Value: %s
                        Expected length: 1
                Parameter 'conference_publication' must be a scalar value.
                        Reference: %s
        From Data::MARC::Field008::Utils::check_government_publication():
                Parameter 'government_publication' has bad value.
                        Value: %s
                Parameter 'government_publication' is required.
                Parameter 'government_publication' length is bad.
                        Length: %s
                        Value: %s
                        Expected length: 1
                Parameter 'government_publication' must be a scalar value.
                        Reference: %s
        From Data::MARC::Field008::Utils::check_index():
                Parameter 'index' has bad value.
                        Value: %s
                Parameter 'index' is required.
                Parameter 'index' length is bad.
                        Length: %s
                        Value: %s
                        Expected length: 1
                Parameter 'index' must be a scalar value.
                        Reference: %s
        From Data::MARC::Field008::Utils::check_item_form():
                Parameter 'form_of_item' has bad value.
                        Value: %s
                Parameter 'form_of_item' is required.
                Parameter 'form_of_item' length is bad.
                        Length: %s
                        Value: %s
                        Expected length: 1
                Parameter 'form_of_item' must be a scalar value.
                        Reference: %s
        From Data::MARC::Field008::Utils::check_target_audience():
                Parameter 'target_audience' has bad value.
                        Value: %s
                Parameter 'target_audience' is required.
                Parameter 'target_audience' length is bad.
                        Length: %s
                        Value: %s
                        Expected length: 1
                Parameter 'target_audience' must be a scalar value.
                        Reference: %s

EXAMPLE

use strict;
use warnings;

use Data::Printer;
use Data::MARC::Field008::Book;

# cnb000000096
my $obj = Data::MARC::Field008::Book->new(
        'biography' => ' ',
        'conference_publication' => '0',
        'festschrift' => '|',
        'form_of_item' => ' ',
        'government_publication' => 'u',
        'illustrations' => 'a   ',
        'index' => '0',
        'literary_form' => '|',
        'nature_of_content' => '    ',
        #         89012345678901234
        'raw' => 'a         u0|0 | ',
        'target_audience' => ' ',
);

# Print out.
p $obj;

# Output:
# Data::MARC::Field008::Book  {
#     parents: Mo::Object
#     public methods (15):
#         BUILD
#         Data::MARC::Field008::Utils:
#             check_book_biography, check_book_festschrift, check_book_illustration, check_book_literary_form, check_book_nature_of_content, check_conference_publication, check_government_publication, check_index, check_item_form, check_target_audience
#         Error::Pure:
#             err
#         Error::Pure::Utils:
#             err_get
#         Mo::utils:
#             check_length_fix, check_required
#     private methods (0)
#     internals: {
#         biography                " ",
#         conference_publication   0,
#         festschrift              "|",
#         form_of_item             " ",
#         government_publication   "u",
#         illustrations            "a   ",
#         index                    0,
#         literary_form            "|",
#         nature_of_content        "    ",
#         raw                      "a         u0|0 | ",
#         target_audience          " "
#     }
# }

DEPENDENCIES

Data::MARC::Field008::Utils, Error::Pure Error::Pure::Utils Mo, Mo::utils.

REPOSITORY

https://github.com/michal-josef-spacek/Data-MARC-Field008

AUTHOR

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

http://skim.cz

LICENSE AND COPYRIGHT

© 2025 Michal Josef Špaček

BSD 2-Clause License

VERSION

0.03