1PPI::Token::Number(3) User Contributed Perl DocumentationPPI::Token::Number(3)
2
3
4

NAME

6       PPI::Token::Number - Token class for a number
7

SYNOPSIS

9         $n = 1234;       # decimal integer
10         $n = 0b1110011;  # binary integer
11         $n = 01234;      # octal integer
12         $n = 0x1234;     # hexadecimal integer
13         $n = 12.34e-56;  # exponential notation ( currently not working )
14

INHERITANCE

16         PPI::Token::Number
17         isa PPI::Token
18             isa PPI::Element
19

DESCRIPTION

21       The "PPI::Token::Number" class is used for tokens that represent
22       numbers, in the various types that Perl supports.
23

METHODS

25   base
26       The "base" method is provided by all of the ::Number subclasses.  This
27       is 10 for decimal, 16 for hexadecimal, 2 for binary, etc.
28
29   literal
30       Return the numeric value of this token.
31

CAVEATS

33       Compared to Perl, the number tokenizer is too liberal about allowing
34       underscores anywhere.  For example, the following is a syntax error in
35       Perl, but is allowed in PPI:
36
37          0_b10
38

TO DO

40       - Treat v-strings as binary strings or barewords, not as "base-256"
41         numbers
42
43       - Break out decimal integers into their own subclass?
44
45       - Implement literal()
46

SUPPORT

48       See the support section in the main module.
49

AUTHOR

51       Adam Kennedy <adamk@cpan.org>
52
54       Copyright 2001 - 2011 Adam Kennedy.
55
56       This program is free software; you can redistribute it and/or modify it
57       under the same terms as Perl itself.
58
59       The full text of the license can be found in the LICENSE file included
60       with this module.
61
62
63
64perl v5.34.0                      2022-02-02             PPI::Token::Number(3)
Impressum