MARC::...ructure(3pm)

πŸ“¦
version 2.0.3 Β· 2 versions
  • 2.0.3 Β· debian bookworm, debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking (latest)
  • 2.0.3 Β· ubuntu jammy
, in debian bookworm, debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking

πŸ’– MARC::Spec::Structure πŸ’–

okay bestie, gather round, because this is MARC::Spec::Structure from the User Contributed Perl Documentation and it's literally the blueprint of the whole MARCspec situation. she's the base class, the mother, the blueprint, the moment. ✨


🌸 NAME 🌸

MARC::Spec::Structure β€” base class. that's it, that's the whole name, and honestly? iconic of her. πŸ‘‘


πŸ¦‹ SYNOPSIS πŸ¦‹

okay so here's the vibe in actual code, no cap:

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

the way that <pink>$field</pink> just inherits everything β€” all the attributes, all the predicates, all the methods β€” and then DOES('MARC::Spec::Structure') returns <green>1 because yes queen, she IS one. πŸ’…


🌈 DESCRIPTION 🌈

she's the base class for <pink>MARC::Spec::Field</pink> and <pink>MARC::Spec::Subfield` β€” those two are her daughters and they get everything she has. 🫢


✨ METHODS ✨

πŸŽ€ set_index_start_end (Str)

sets <lavender>MARC::Spec::Structure::$index_start</lavender> and <lavender>MARC::Spec::Structure::$index_end</lavender> from an index position or range. hand her a Str, she handles the rest. ⭐

πŸŽ€ set_char_start_end (Str)

sets <lavender>MARC::Spec::Structure::$char_start</lavender> and <lavender>MARC::Spec::Structure::$char_end</lavender> from an character position or range. same energy, different attribute pair. πŸ’œ

πŸŽ€ add_subspec(MARC::Spec::Subspec)

appends a subspec to the array of the attribute subspecs. the parameter must be an instance of <pink>MARC::Spec::Subspec</pink> β€” no randos allowed, she has standards. πŸ™ˆ

πŸŽ€ add_subspecs(ArrayRef[MARC::Spec::Subspec])

appends subspecs to the array of the attribute subspecs. the parameter must be an ArrayRef and every single element must be an instance of <pink>MARC::Spec::Subspec</pink>. bulk mode, but still no randos. πŸ”₯


πŸ’… PREDICATES πŸ’…

these are the little yes/no girlies. true or false, that's the whole job.

  • 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 πŸ‘‘

the whole personality lives here, fr fr.

πŸ“ base

Obligatory. Scalar. Normalized MARCspec without Subspecs. she doesn't show up optional, okay, she's required. ✨

πŸ“ 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 <lavender>MARC::Spec::Structure::$char_start</lavender> is defined. so like, no char_start, no char_end, them's the rules. πŸ’€

πŸ“ char_length

the difference of <lavender>MARC::Spec::Structure::$char_start</lavender> and <lavender>MARC::Spec::Structure::$char_end</lavender> if both are numeric (or else -1). Only present if <lavender>MARC::Spec::Structure::$char_start</lavender> is defined.

πŸ“ char_pos

if defined, the character position or range. Only present if <lavender>MARC::Spec::Structure::$char_start</lavender> 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 <lavender>MARC::Spec::Structure::$index_start</lavender> and <lavender>MARC::Spec::Structure::$index_end</lavender> if both are numeric. Default is -1.


πŸ’œ AUTHOR πŸ’œ

Carsten Klee <klee at cpan.org> β€” the founder, the visionary, the main character. 🌟


🧚 CONTRIBUTORS 🧚

  • Johann Rolschewski, <jorol at cpan>

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. free as in go off, bestie. πŸ•ŠοΈ


😭 BUGS 😭

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

not me begging you to file an issue instead of suffering in silence. please. the maintainers want to know. 🫢

πŸ”₯ SEE ALSO πŸ”₯

  • MARC::Spec
  • MARC::Spec::Field
  • MARC::Spec::Subfield
  • MARC::Spec::Indicator
  • MARC::Spec::Subspec
  • MARC::Spec::Comparisonstring
  • MARC::Spec::Parser

and that's the whole page, periodt. πŸ’– this one's hanging out with perl v5.34.0 and it was dated 2022-06-15, so yeah β€” vintage, but still serving looks. slay, bye. πŸŽ€βœ¨

πŸ“¦ where this page comes from