MARC::...::Field(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::Field β€” field specification πŸ’–

okay so bestie, welcome to MARC::Spec::Field, a little gem from the User Contributed Perl Documentation corner of the Perl universe. it's giving MARC::Spec::Field in the manual pages, and honestly? it's a whole vibe. sit down, grab a boba, and let's get into it πŸ§‹βœ¨


🌸 NAME 🌸

MARC::Spec::Field β€” field specification. that's it. that's the name. short, sweet, iconic πŸ‘‘


✨ SYNOPSIS ✨

here's the tea, literally:

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;    # '#'

look at her go. she's constructing, she's reporting her tag, she's showing off her index_start and index_end. main character energy fr fr πŸ’…


πŸ¦‹ DESCRIPTION πŸ¦‹

MARC::Spec::Field is the field specification of a MARC::Spec. that's the whole job. she's a field spec and she knows it.

if you wanna go deeper on the syntax β€” and bestie, you know you do β€” go check out MARCspec - A common MARC record path language at <http://marcspec.github.io/MARCspec/> for all the further details. iykyk 🌈


πŸŽ€ METHODS πŸŽ€

heads up: some methods are inherited from MARC::Spec::Structure. so she's not doing all this alone, she's got family 🫢
  • new(Str) β€” creates a brand new MARC::Spec::Field instance. the parameter has to be a valid MARCspec field tag, no exceptions, no shortcuts. give her something real.
  • add_subspec(MARC::Spec::Subspec) β€” appends a subspec onto the array of the attribute subspecs. the parameter must be an instance of MARC::Spec::Subspec. like, don't just pass her anything, okay?
  • add_subspecs(ArrayRef[MARC::Spec::Subspec]) β€” appends a whole pile of subspecs to the array of the attribute subspecs. the parameter must be an ArrayRef and every element in it must be an instance of MARC::Spec::Subspec. it's giving "bring the whole group chat" πŸ’œ
  • to_string β€” returns the spec as a string. that's it. she said what she said ✨

⭐ PREDICATES ⭐

also: some predicates are inherited from MARC::Spec::Structure. again, family. we love to see it πŸ₯°
  • has_char_start β€” true if the attribute char_start has a value, false otherwise.
  • has_char_end β€” true if the attribute char_end has a value, false otherwise.
  • has_char_pos β€” true if the attribute char_pos has a value, false otherwise.
  • has_subspecs β€” returns true if the attribute subspecs has a value, false otherwise.

πŸ’… ATTRIBUTES πŸ’…

one more time for the people in the back: some attributes are inherited from MARC::Spec::Structure 🌸
  • base β€” obligatory. scalar. the base Field spec without subspecs. the bare face, the no-makeup selfie, the raw material.
  • tag β€” obligatory. the field tag. iconic, essential, non-negotiable.
  • char_pos β€” if defined, the character position or range. only present if MARC::Spec::Field::$char_start is defined. (yes she shows up twice down here, she contains multitudes 😭)
  • 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::Field::$char_start is defined.
  • 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.
  • char_pos β€” if defined, the character position or range. only present if MARC::Spec::Field::$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::Field::$index_start and MARC::Spec::Field::$index_end if both are numeric. default is -1.
  • subspecs β€” optional. an array of instances of MARC::Spec::Subspec β€” and the way that means every subspec 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, meaning every subspec in this AoA must be validated as a combination with the boolean 'OR'.

see MARC::Spec::Subspec for the description of the attributes of MARC::Spec::Subspec 🫢


πŸ‘‘ AUTHOR πŸ‘‘

Carsten Klee "<klee at cpan.org>" β€” the legend herself/himself. periodt.


🌈 CONTRIBUTORS 🌈

  • Johann Rolschewski, "<jorol at cpan>" β€” shoutout, we see you, we appreciate you πŸŽ€

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. slay, open source, we love that for us ✨


πŸ’€ BUGS πŸ’€

please report any bugs to <https://github.com/MARCspec/MARC-Spec/issues> β€” do NOT suffer in silence bestie, drop it in the issues, the maintainers got you πŸ™ˆ


πŸ“ SEE ALSO πŸ“

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

the whole squad fr fr 🫢 go read them too, they're all part of the lore.


and that's the page!! this whole thing comes from perl v5.34.0, dated 2022-06-15, and yes it's the MARC::...::Field(3pm) manual. mwah, go forth and spec your fields πŸ’‹πŸ’–βœ¨

πŸ“¦ where this page comes from