The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

MARC::Spec::Field

SYNOPSIS

    use MARC::Spec::Field;
    
    my $field = MARC::Spec::Field->new('246');
    say ref $field;           # MARC::Spec::Field
    say $field->tag;          # 246
    say $field->index_start;  # 0
    say $field->index_end;    # '#'

DESCRIPTION

MARC::Spec::Field is the field specification of a MARC::Spec.

See MARCspec - A common MARC record path language for further details on the syntax.

METHODS

Some methods are inherited from MARC::Spec::Structure.

new(Str)

Create a new MARC::Spec::Field instance. Parameter must be a valid MARCspec field tag.

add_subspec(MARC::Spec::Subspec)

Appends a subspec to the array of the attribute subspecs. Parameter must be an instance of MARC::Spec::Subspec.

Inherited from MARC::Spec::Structure.

add_subspecs(ArrayRef[MARC::Spec::Subspec])

Appends subspecs to the array of the attribute subspecs. Parameter must be an ArrayRef and elements must be instances of MARC::Spec::Subspec.

Inherited from MARC::Spec::Structure.

to_string

Returns the spec as a string.

Inherited from MARC::Spec::Structure.

PREDICATES

has_subspecs

Returns true if attribute subspecs has a value and false otherwise.

Inherited from MARC::Spec::Structure.

ATTRIBUTES

Some attributes are inherited from MARC::Spec::Structure.

base

Obligatory. The base Field spec without subspecs.

Inherited from MARC::Spec::Structure.

tag

Obligatory. The field tag.

char_pos

If defined, the character position or range. Only present if MARC::Spec::Field::$char_start is defined.

Inherited from MARC::Spec::Structure.

char_start

If defined, the beginning character position of a character position or range.

Inherited from MARC::Spec::Structure.

char_end

If defined, the ending character position of a character position or range. Only present if MARC::Spec::Field::$char_start is defined.

Inherited from MARC::Spec::Structure.

char_length

The difference of MARC::Spec::Field::$char_start and MARC::Spec::Field::$char_end if both are numeric (or else -1). Only present if MARC::Spec::Field::$char_start is defined.

Inherited from MARC::Spec::Structure.

index_start

Obligatory. The beginning index of field repetitions. Maybe a positiv integer or the character '#'. Default is 0.

Inherited from MARC::Spec::Structure.

index_end

Obligatory. The ending index of field repetitions. Maybe a positiv integer or the character '#'. Default is '#'.

Inherited from MARC::Spec::Structure.

index_length

Obligatory. The difference of MARC::Spec::Field::$index_start and MARC::Spec::Field::$index_end if both are numeric. Default is -1.

Inherited from MARC::Spec::Structure.

indicator1

If defined, the indicator 1 of a data field. Only present if MARC::Spec::Field::$char_start is not defnied.

indicator2

If defined, the indicator 2 of a data field. Only present if MARC::Spec::Field::$char_start is not defnied.

subspecs

Optional. An array of instances of MARC::Spec::Subspec, thus all subspecs in this array MUST be validated as a combination with the boolean 'AND', and/or an array of arrays (AoA) of instances of MARC::Spec::Subspec, thus all subspecs in this AoA must be validated as a combination with the boolean 'OR'.

See MARC::Spec::Subspec for description of attributes of MARC::Spec::Subspec.

Inherited from MARC::Spec::Structure.

AUTHOR

Carsten Klee <klee at cpan.org>

CONTRIBUTORS

  • Johann Rolschewski, <jorol at cpan>

COPYRIGHT AND LICENSE

This software is copyright (c) 2016 by Carsten Klee.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.

BUGS

Please report any bugs to https://github.com/MARCspec/MARC-Spec/issues

SEE ALSO

MARC::Spec, MARC::Spec::Subfield, MARC::Spec::Subspec, MARC::Spec::Structure, MARC::Spec::Comparisonstring, MARC::Spec::Parser