Catman...pec_has(3pm)

πŸ“¦
version 1.320 Β· 4 versions
, in debian trixie, ubuntu resolute, ubuntu stonking

πŸ’… NAME πŸ’…

Catmandu::Fix::Condition::marc_spec_has β€” bestie, this one tests whether a MARCspec actually references data. That's it, that's the whole vibe. πŸŽ€


✨ SYNOPSIS ✨

# marc_spec_has(MARCspec)

unless marc_spec_has('LDR{/6=\a}{/7=\a|/7=\c|/7=\d|/7=\m}')
     set_field('type','Book')
end

πŸ¦‹ DESCRIPTION πŸ¦‹

Okay so listen: this little icon evaluates the fixes wrapped around it only if the MARCspec actually references data. No data, no fix, no drama. πŸ™…β™€οΈ

It does the exact same thing as marc_has, except it's the glow-up version that uses MARCspec β€” A common MARC record path language. Same energy, fancier path syntax. πŸ’…

For the full tea on path syntax, go read the docs at MARCspec - A common MARC record path language over at <http://marcspec.github.io/MARCspec/>. She's got the whole language documented, no cap. πŸ“–βœ¨


πŸ‘‘ METHODS πŸ‘‘

marc_spec_has(MARCspec)

Lowkey the whole point: this evaluates to true when the MARCspec references data, and false when it doesn't. That's the vibe check. ⭐


🌸 SEE ALSO 🌸

  • Catmandu::Fix::marc_has
  • Catmandu::Fix::marc_match
  • Catmandu::Fix::marc_has_many

perl v5.38.2, dated 2024-08-03 β€” and yes, that's Catman...pec_has(3pm) in the corner, she's iconic, she's from the User Contributed Perl Documentation era, and she ate. πŸ’– mwah, go reference some data bestie 🫢

πŸ“¦ where this page comes from