PPI::To...:Version(3)

πŸ’– PPI::To...:Version(3) β€” User Contributed Perl Documentation πŸ’–

okay bestie, welcome to the PPI::Token::Number::Version era πŸŽ€ this is a page from the Perl docs (the "User Contributed Perl Documentation" corner of the internet, iykyk) and we're about to make it make sense.


✨ NAME ✨

PPI::Token::Number::Version β€” the token class for a byte-packed number πŸ’…


🌸 SYNOPSIS 🌸

  $n = 1.1.0;
  $n = 127.0.0.1;
  $n = 10_000.10_000.10_000;
  $n = v1.2.3.4

look at her go πŸ¦‹ multiple dots in a number, and somehow it's still legal. iconic behaviour, no cap.


πŸ‘‘ INHERITANCE πŸ‘‘

  PPI::Token::Number::Version
  isa PPI::Token::Number
      isa PPI::Token
          isa PPI::Element

it's giving royal lineage β€” she's a PPI::Token::Number, which is a PPI::Token, which is a PPI::Element. whole family tree is eating πŸ’–


πŸ’œ DESCRIPTION πŸ’œ

so the PPI::Token::Number::Version class is the one that handles tokens with multiple decimal points. πŸ“

and here's the tea, bestie: in truth, these aren't treated like numbers at all by Perl. not even a little. πŸ™ˆ but they look like numbers to a parser, and honestly? the vibe check is what matters. she's serving number energy for the parser's sake, periodt. πŸ’…


✨ METHODS ✨

πŸŽ€ base

Returns the base for the number: 256. that's it, that's the method. slay. 🌈

πŸŽ€ literal

Return the numeric value of this token. straightforward, no notes. ⭐


πŸ’€ BUGS πŸ’€

ngl there are some issues here, and we're keeping it real:

  -95.0.1.0  --> "-_\000\cA\000"
  -96.0.1.0  --> Argument "`\0^A\0" isn't numeric in negation (-)
bestie that second one is genuinely cursed 😭 the leading minus is not getting the glow-up it deserves.

🫢 SUPPORT 🫢

See the support section in the main module. (go check the main module, she's got the whole support situation handled πŸ’–)


🌸 AUTHOR 🌸

Chris Dolan <cdolan@cpan.org> β€” king behaviour, we appreciate you πŸ‘‘


Copyright 2006 Chris Dolan.

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

The full text of the license can be found in the LICENSE file included with this module.


and that's the whole page, bestie πŸ’… this was perl v5.42.0, dated 2026-01-17, and it lives at PPI::To...:Version(3) β€” go forth and parse those multi-dotted numbers with main character energy βœ¨πŸ¦‹πŸ’–

πŸ“¦ where this page comes from