Dublin...Element(3pm)
π DublinCore::Element β NAME π
okay so bestie, <rainbow>DublinCore::Element</rainbow> is literally the class that represents a Dublin Core element. that's it, that's the whole vibe. it lives in the 3pm manual, in the user contributed Perl documentation corner of the world, and it's about to be your new fave π
β¨ SYNOPSIS β¨
here's the whole thing in one lil' snack:
my $element = DublinCore::Element->new( \%info );
print "content: ", $element->content(), "\n";
print "qualifier: ", $element->qualifier(), "\n";
print "language: ", $element->language(), "\n";
print "scheme: ", $element->scheme(), "\n";
look at that. four prints. zero drama. she's efficient π
π¦ DESCRIPTION π¦
so here's the tea. methods over on DublinCore::Record β think element(), elements(), title(), and the rest of the crew β they hand you back DublinCore::Element objects as their result. and then? you can interrogate those lil' objects further to pull out an element's content, qualifier, language, and schema.
and if you want the actual definitions of these attributes, not just my summary of them, go read RFC 2731 and also <http://www.dublincore.org>. those are the sources, bestie, I'm just the messenger π«Ά
π METHODS π
πΈ new()
the constructor. she takes a hashref of input arguments. that's the whole thing:
DublinCore::Element->new( \%info );
πΈ content()
gets and sets the content of the element. it does both. she's versatile like that.
## extract the element
my $title = $record->element( 'title' );
print $title->content();
## or you can chain them together
print $record->element( 'title' )->content();
the chaining version? main character energy. no cap π₯
πΈ qualifier()
gets and sets the qualifier used by the element.
πΈ language()
gets and sets the language of the content in element.
πΈ scheme()
gets and sets the scheme used by the element.
πΈ name()
gets and sets the element name β you know, title, creator, date, etc. the classics π
πΈ is_empty()
gets and sets the "empty" status of an element. this one's highkey useful when you're using DublinCore::Record's element() method.
say you wanna see if the record has an creator elements:
if( $record->element( 'creator' )->is_empty ) {
# no creators
}
yes, checking is_empty is literally the vibe check for your element. if she's empty, she's empty, periodt π
πΈ set()
this function overrides the default set() behavior, and the reason is very specific: it's so that it can remove the is_empty flag. iconic behavior honestly π
β SEE ALSO β
DublinCore::Record
π AUTHOR π
- Ed Summers
<ehs@pobox.com> - Brian Cassidy
<bricas@cpan.org>
give them their flowers, they earned them πΈ
π COPYRIGHT AND LICENSE π
Copyright 2007 by Ed Summers, Brian Cassidy
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
so yeah, that's the whole page. free software, same terms as Perl itself, no cap π
and a lil' sign-off from me to you: this page is perl v5.34.0, dated 2022-06-13, and it's part of the Dublin...Element(3pm) manual. go forth and query your elements, bestie π¦β¨π
π¦ where this page comes from
- debian bookworm: libdublincore-record-perl 0.03-4 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- debian trixie: libdublincore-record-perl 0.03-4 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: libdublincore-record-perl 0.03-4 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libdublincore-record-perl 0.03-4 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libdublincore-record-perl 0.03-4 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms