XML::Li...::Number(3)

πŸ’– NAME πŸ’–

XML::LibXML::Number β€” it's giving simple numeric values, and honestly? That's the whole job description. No notes. ✨


🌸 DESCRIPTION 🌸

Okay so bestie, picture this: a whole class whose entire personality is holding a simple numeric value. That's it. That's the girl. πŸ’…

Now, the XPath spec says she should support -0, +/- Infinity, and NaN… and she does not. Not -0, not +/- Infinity, not NaN. The spec said "do it" and she said "no <3". πŸ™ˆ But per the original author: he's not hurting anyone, he doesn't think. So like, we move. 🫢

Heads up: this is a documented gap between what the XPath spec asks for and what this class actually does. It's real, it's known, and it's not getting fixed in this paragraph. πŸ’€

πŸŽ€ API πŸŽ€

✨ new($num) ✨

Spins up a brand new XML::LibXML::Number object and tucks the value in $num inside it. πŸ‘‘

It also does some rudimentary numeric checking on $num β€” like, just a quick vibe check to make sure it actually is a number before letting it in the club. 🌈

πŸ¦‹ value() πŸ¦‹

Returns the numeric value she's been holding this whole time. πŸ’–

Oh and also β€” this one moonlights as the overloaded stringification method. So when the object gets stringified, value() is who shows up. Main character energy, honestly. ⭐


and that's the whole page, bestie 🧚 this little gem ships as part of perl v5.42.2, dated 2026-05-25, filed under the truncated header XML::Li...::Number(3) β€” yeah the header ran out of room, she's ✨mysterious✨ like that. bye mwah πŸ’‹

πŸ“¦ where this page comes from