HTML::O...Literal(3)

πŸ“¦ version 0.6.0, in alpine 3.24

πŸ’– HTML::Object::XPath::Literal(3) β€” HTML Object XPath Literal πŸ’–

okay bestie, welcome to the manual page for HTML::O...Literal(3) from the User Contributed Perl Documentation crew. This is the XPath literal module, and it is lowkey serving β€œstring but make it object.” πŸŽ€βœ¨

🌸 NAME 🌸

HTML::Object::XPath::Literal β€” HTML Object XPath Literal

πŸ¦‹ SYNOPSIS πŸ¦‹

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

πŸ“ VERSION πŸ“

This one is v0.2.1, no cap.

🧚 DESCRIPTION 🧚

This module implements the equivalent of a string in XPath parlance. That’s the whole vibe: literal string, XPath edition. slay. πŸ’…

✨ METHODS ✨

πŸ’– new β€” new literal, who dis?

Provided with a "string", this creates a new HTML::Object::XPath::Literal object with the value you hand it (the source says providedd, and we respect the typo). Note that " and ' will be converted to " and ' respectively. That is not part of the XPath specification, but the author considers 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:

<input type="text" value="&quot;I am feeling &amp;quot;perplex&amp;quot;&quot;" />

Which produces a Literal of:

I am feeling "perplex"

🌸 as_string

Returns a string representation of the literal. Cute, simple, stringified. This method ate. ✨

πŸ¦‹ as_xml

Returns a string representation of the literal as xml. XML girlies rise. πŸ’œ

πŸŽ€ cmp

This is a method used for overload. Provided with another object or string, this will return the same value as cmp in perlop, that is it β€œreturns -1, 0, or 1 depending on whether the left argument is stringwise less than, equal to, or greater than the right argument.” Periodt. πŸ’…

⭐ evaluate

It returns the current object. Main character energy: it simply returns itself. πŸ‘‘

πŸ’€ getChildNodes

This raises an exception, as it cannot be used. Hard no, bestie. 🚫

πŸ’€ getAttributes

This raises an exception, as it cannot be used. Same hard no. 🚫

πŸ’€ getParentNode

This raises an exception, as it cannot be used. The no continues. 🚫

πŸ”₯ new_number

Returns a new number object based on the value provided. Number object activated. πŸ”’

πŸ“ string_value

Returns the value of the literal as returned by value. It’s giving β€œsame value, different door.” πŸšͺ

🌈 to_boolean

Returns true if the literal value is true, or false otherwise. Boolean vibe check. βœ…βŒ

πŸ’œ to_literal

Returns the current object. Again, main character energy. πŸ‘‘

🌟 to_number

Returns a new number object from the value of the literal. Number object, but sourced from the literal. πŸ”’

🧚 value

This returns the literal string value. It is also called upon stringification. So when the object gets stringified, this is the method on duty. πŸ’…

πŸŽ€ value_as_number

Returns the literal value as a number (not a number object), but forcing perl to treat it as a number, i.e. prepending it with a plus sign. Raw number, no object wrapper. ✨

πŸ‘‘ AUTHOR πŸ‘‘

Jacques Deguest <jack@deguest.jp>. iykyk.

🫢 SEE ALSO 🫢

Go check these out, fr fr:

  • HTML::Object::XPath
  • HTML::Object::XPath::Boolean
  • HTML::Object::XPath::Expr
  • HTML::Object::XPath::Function
  • HTML::Object::XPath::Literal
  • HTML::Object::XPath::LocationPath
  • HTML::Object::XPath::NodeSet
  • HTML::Object::XPath::Number
  • HTML::Object::XPath::Root
  • HTML::Object::XPath::Step
  • HTML::Object::XPath::Variable

The formal tea, periodt:

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.


okay that’s the whole manual, bestie! Footer tea: this page is from perl v5.42.2, dated 2026-02-15, and the manual tag is HTML::O...Literal(3). go off and literal-ify something cute πŸ’…πŸ«Ά

πŸ“¦ where this page comes from