HTML::O...:Literal(3)

๐Ÿ“ฆ version 0.6.0, in alpine 3.24

๐ŸŒธ NAME ๐ŸŒธ โ€” HTML::O...:Literal(3) / HTML::Object::Literal

okay so bestie, this is the User Contributed Perl Documentation page for HTML::Object::Literal โ€” Simple string values. It's giving tiny string object with XPath energy, and we're gonna cover every single method. ๐Ÿ’–

๐ŸŽ€ SYNOPSIS ๐ŸŽ€

use HTML::Object::Literal;
my $this = HTML::Object::Literal->new || die( HTML::Object::Literal->error, "\n" );

๐Ÿท๏ธ VERSION ๐Ÿท๏ธ

v0.2.0 โ€” periodt. โœจ

๐Ÿฆ‹ DESCRIPTION ๐Ÿฆ‹

In XPath terms a Literal is what we know as a string. No cap. ๐Ÿช„

This module inherits from Module::Generic::Scalar โ€” that's the family tree, bestie. ๐ŸŒณ

๐Ÿ’… METHODS ๐Ÿ’…

๐Ÿ’– new

Provided with a "string" and this will create a new Literal object with the value in "string". Note that " and ' will be converted to " and ' respectively. That is not part of the XPath specification, but I consider it useful. Note though that you have to go to extraordinary lengths in an XML template file (be it XSLT or whatever) to make use of this โ€” like, genuinely extraordinary lengths, bestie:

<xsl:value-of select="&quot;I am feeling &amp;quot;sad&amp;quot;&quot;"/>

Which produces a Literal of:

I am feeling "sad"

๐Ÿ“ as_string

Returns a string representation of this literal. ๐Ÿงต

๐Ÿ“„ as_xml

Returns a string representation as xml. โœจ

๐Ÿ˜ด evaluate

Does nothing. Returns the current object. It's literally the โ€œno thoughts, head emptyโ€ method. ๐Ÿซง

๐Ÿšจ getAttributes

If called, this would return an error. ๐Ÿ›‘

๐Ÿšจ getChildNodes

If called, this would return an error. ๐Ÿ›‘

๐Ÿšจ getParentNode

If called, this would return an error. ๐Ÿ›‘

๐ŸŽฏ string_value

Returns the current value as-is. ๐Ÿ’ฏ

โœ… to_boolean

Returns the current value as a boolean. ๐Ÿ”˜

๐Ÿชž to_literal

Returns the current object. ๐Ÿ‘ฏ

๐Ÿ”ข to_number

Returns the current value as a number. ๐Ÿงฎ

๐Ÿงธ value

Also overloaded as stringification, simply returns the literal string value. ๐ŸŽ€

๐Ÿ”ข value_as_number

Returns the current value as a number. ๐Ÿงฎ

๐Ÿ‘‘ AUTHOR ๐Ÿ‘‘

Jacques Deguest <jack@deguest.jp> โ€” iconic author behavior. ๐Ÿ’Œ

๐Ÿงš SEE ALSO ๐Ÿงš

All the related modules, bestie:

  • HTML::Object
  • HTML::Object::Attribute
  • HTML::Object::Boolean
  • HTML::Object::Closing
  • HTML::Object::Collection
  • HTML::Object::Comment
  • HTML::Object::Declaration
  • HTML::Object::Document
  • HTML::Object::Element
  • HTML::Object::Exception
  • HTML::Object::Literal
  • HTML::Object::Number
  • HTML::Object::Root
  • HTML::Object::Space
  • HTML::Object::Text
  • HTML::Object::XQuery

Copyright (c) 2021 DEGUEST Pte. Ltd.

All rights reserved

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.


bye bestie! ๐Ÿซถ This page's source/version is perl v5.42.2, dated 2026-02-15, and the footer tag is HTML::O...:Literal(3). Stay slay and go wrap some strings. ๐Ÿ’…โœจ

๐Ÿ“ฆ where this page comes from