---
name: "MARC::Spec::Structure"
section: "3pm"
platform: "linux"
package: "libmarc-spec-perl"
version: "2.0.3-2"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/MARC::Spec::Structure"
---

# MARC::Spec::Structure(3pm)

base class

## NAME

MARC::Spec::Structure - base class

## SYNOPSIS

```
    use MARC::Spec::Field;

    # create a new field
    my $field = MARC::Spec::Field->new('246');

    # field does inherit all attributes, predicates and methods
    say $field->DOES('MARC::Spec::Structure'); # 1
```

## DESCRIPTION

Is the base class for MARC::Spec::Field and MARC::Spec::Subfield.

## METHODS

### set\_index\_start\_end (Str)

Sets MARC::Spec::Structure::$index\_start and MARC::Spec::Structure::$index\_end from an index position or range.

### set\_char\_start\_end (Str)

Sets MARC::Spec::Structure::$char\_start and MARC::Spec::Structure::$char\_end from an character position or range.

### add\_subspec(MARC::Spec::Subspec)

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

### 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.

## PREDICATES

### has\_char\_start

True if attribute char\_start has an value and false otherwise.

### has\_char\_end

True if attribute char\_end has an value and false otherwise.

### has\_char\_pos

True if attribute char\_pos has an value and false otherwise.

### has\_subspecs

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

## ATTRIBUTES

### base

Obligatory. Scalar. Normalized MARCspec without Subspecs.

### char\_start

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

### char\_end

If defined, the ending character position of a character position or range. Only present if MARC::Spec::Structure::$char\_start is defined.

### char\_length

The difference of MARC::Spec::Structure::$char\_start and MARC::Spec::Structure::$char\_end if both are numeric (or else -1). Only present if MARC::Spec::Structure::$char\_start is defined.

### char\_pos

If defined, the character position or range. Only present if MARC::Spec::Structure::$char\_start is defined.

### index\_start

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

### index\_end

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

### index\_length

Obligatory. The difference of MARC::Spec::Structure::$index\_start and MARC::Spec::Structure::$index\_end if both are numeric. Default is -1.

## 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::Field

- •

  MARC::Spec::Subfield

- •

  MARC::Spec::Indicator

- •

  MARC::Spec::Subspec

- •

  MARC::Spec::Comparisonstring

- •

  MARC::Spec::Parser
