XML::A...egories(3pm)
β¨ XML::Atom::Categories β¨
okay bestie, gather round π this is XML::Atom::Categories β the Atom Category Document object and she is, lowkey, the whole vibe. Category Documents, category elements, autodiscovery... we're doing all of it. no cap. π
πΈ SYNOPSIS πΈ
use XML::Atom::Service;
my $category = XML::Atom::Category->new;
$category->term('joke');
$category->scheme('http://example.org/extra-cats/');
my $categories = XML::Atom::Categories->new;
$categories->add_category($category);
my $xml = $categories->as_xml;
# Get a list of the category elements.
my @category = $categories->category;
see how clean that is? iconic behavior honestly π¦
π DESCRIPTION π
Category Documents contain lists of categories, and those categories are described using the atom:category element from the Atom Syndication Format [RFC4287]. yes, the whole squad is here β¨
The Category Document itself is defined in "The Atom Publishing Protocol," IETF Internet-Draft. so like, it's giving official, but also it's giving draft. both can be true π«Ά
π METHODS π
π XML::Atom::Categories->new([ $stream ])
Creates a brand new Category Document object. and if $stream is supplied, she fills it up with the data specified by $stream. self-care honestly.
Automatically handles autodiscovery if $stream is a URI (see below π). she's smart like that, no notes.
Returns the new XML::Atom::Categories object. On failure, returns undef π (we don't talk about failure).
$stream can be any one of the following:
- Reference to a scalar β this is treated as the XML body of the Category Document.
- Scalar β this is treated as the name of a file containing the Category Document XML.
- Filehandle β this is treated as an open filehandle from which the Category Document XML can be read.
- URI object β this is treated as a URI, and the Category Document XML will be retrieved from the URI.
so basically you can hand her a string, a filename, an open filehandle, or a URI, and she'll figure it out. main character energy fr fr π
π $categories->categoryk([ $category ])
(that's the method name, exactly as written, we do not edit the queen's spelling π)
If called in scalar context, returns an XML::Atom::Category object corresponding to the first app:category element found in the Category Document.
If called in list context, returns a list of XML::Atom::Category objects corresponding to all of the app:category elements found in the Service Document. β¨ (yes, Service Document β that's what the page says, so that's what we're saying π«Ά)
π $service->add_category($category)
Adds the category $category, which must be an XML::Atom::Category object, to the Service Document as a new app:category element. like, must must. don't try to sneak anything else in there bestie π
for example:
my $category = XML::Atom::Category->new;
$category->term('joke');
$categories->add_category($category);
β $categories->fixed
β $categories->scheme
β $categories->href
β $categories->element_name
β $categories->element_ns
(yes, these are just listed. they're the little accessor icons of the group chat π)
π₯ SEE ALSO π₯
XML::AtomXML::Atom::ServiceAtompub
π¦ AUTHOR π¦
Takeru INOUE, <takeru.inoue _ gmail.com> β legend behavior, we stan π
πΈ LICENCE AND COPYRIGHT πΈ
Copyright (c) 2007, Takeru INOUE "<takeru.inoue _ gmail.com>". All rights reserved.
This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See perlartistic. periodt. β¨
π DISCLAIMER OF WARRANTY π
okay bestie, this part is in ALL CAPS for a reason and we are NOT paraphrasing it, we are delivering it with full dramatic energy:
BECAUSE THIS SOFTWARE IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE SOFTWARE, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE SOFTWARE "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE SOFTWARE IS WITH YOU. SHOULD THE SOFTWARE PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR, OR CORRECTION.
no warranty bestie. none. zero. the risk is yours and it's giving fully yours. π
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE SOFTWARE AS PERMITTED BY THE ABOVE LICENCE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE SOFTWARE (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE SOFTWARE TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
and that's the whole page, bestie π«Ά this one came from perl v5.34.0, dated 2022-06-28, and yes the header/footer both say XML::A...egories(3pm) because apparently even the manpage title got the abbreviation treatment. slay. π
β¨
π¦ where this page comes from
- debian bookworm: libxml-atom-service-perl 0.16.2-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- debian trixie: libxml-atom-service-perl 0.16.2-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: libxml-atom-service-perl 0.16.2-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libxml-atom-service-perl 0.16.2-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libxml-atom-service-perl 0.16.2-3 Β· 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