Perinc...etadata(3pm)

πŸ“¦
version 0.311 Β· 3 versions
, in ubuntu noble, ubuntu resolute, ubuntu stonking

πŸ’– Perinci::Object::Metadata β€” the manual, but make it a group chat πŸ’–

okay so bestie, you're looking at Perinci::Object::Metadata(3pm) from the Perl world. It's the base class for the Perinci::Object metadata classes, so like… everything else in that family is basically its little sibling. periodt.


✨ NAME ✨

Perinci::Object::Metadata β€” it's the base class for the Perinci::Object metadata classes πŸŽ€


πŸ¦‹ VERSION πŸ¦‹

This doc is describing version 0.311 of Perinci::Object::Metadata (and yes, it's from the Perl distribution called Perinci-Object), released on 2020-01-02. she's a lil vintage, she's still iconic πŸ’…


πŸ‘‘ METHODS πŸ‘‘

okay here's the whole menu, no skips, no skims, we're doing all of them fr fr 🫢

πŸŽ€ new => obj

Constructor. that's it, that's the vibe β€” it makes a new object ✨

πŸŽ€ v => float

Get the version. just the number, bestie πŸ’œ

πŸŽ€ as_struct => hash

Get the underlying data structure. like, the raw thing under the cute wrapper πŸ“

πŸŽ€ type => str

Return the type β€” e.g. "function", "package" πŸ‘‘ she's telling you what she is, main character energy

πŸŽ€ langprop([ \%opts, ]$prop[, $new_value])

Get or set a property value in a specific language. To be precise: it looks at either the "prop" property, or the "prop.alt.lang.XXX" properties. multilingual queen 🌈

Known options (yes we're listing all of them):

  • lang => STR β€” defaults to the metadata's "default_lang", which in turn defaults to "en_US" if nobody specified anything. so if you're silent about it, it assumes "en_US", no cap πŸ’€
  • mark_different_lang => BOOL (defaults to 1) β€” if you set this to true, text in a different language than the one you asked for gets marked. The example from the source: you ask for "I love you" in Indonesian but there's no Indonesian value available, so what comes back is "{en_US I love you}" β€” flagged, labeled, called out πŸ™ˆ it's giving "we don't have that translation so here's the one we got, clearly tagged"

πŸŽ€ name([ $new_value ]) => $value

Get or set the "name" property. Heads up: it will call "langprop()" for you 🫢

πŸŽ€ summary([ $new_value ]) => $value

Get or set the "summary" property. Also calls "langprop()" ✨

πŸŽ€ description([ $new_value ]) => $value

Get or set the "description" property. Yep β€” "langprop()" again πŸ’…

πŸŽ€ caption([ $new_value ]) => $value

Get or set the "caption" property. And yes bestie, "langprop()" once more 🌸

ngl the pattern is: all four of those property methods ride on langprop(). that's the whole bit, and honestly? slay.

🌟 HOMEPAGE 🌟

The project's homepage lives at <https://metacpan.org/release/Perinci-Object>. go visit her, she'd love that πŸ¦‹


🧚 SOURCE 🧚

The source repo is at <https://github.com/perlancar/perl-Perinci-Object>. it's right there, lowkey iconic πŸŽ€


πŸ’€ BUGS πŸ’€

Found a bug? Got a feature request? Please report it on the bugtracker: <https://github.com/perlancar/perl-Perinci-Object/issues> πŸ™ˆ

And when you submit a bug or a request, please include a test-file or a patch to an existing test-file that shows the bug or the desired feature. not me asking you to actually reproduce it β€” yes i am, do it, it helps so much 😭🫢


πŸ’œ AUTHOR πŸ’œ

perlancar <perlancar@cpan.org> β€” the legend themselves πŸ‘‘


This software is copyright (c) 2021, 2017, 2016, 2015, 2014, 2013, 2012, 2011 by perlancar@cpan.org.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. so like, go wild, but respectfully πŸ’–


and that's the whole page bestie β€” every option, every default, every method, nothing skipped 😀 This was Perinci::Object::Metadata, documented as part of perl v5.36.0, dated 2022-10-13, and yeah β€” the header and footer both truncate the name to Perinc...etadata(3pm) because the terminal ran out of room, and honestly? relatable. she doesn't need the whole name to know who she is πŸ’…βœ¨

πŸ“¦ where this page comes from