1PPI::Token::Quote(3)  User Contributed Perl Documentation PPI::Token::Quote(3)
2
3
4

NAME

6       PPI::Token::Quote - String quote abstract base class
7

INHERITANCE

9         PPI::Token::Quote
10         isa PPI::Token
11             isa PPI::Element
12

DESCRIPTION

14       The "PPI::Token::Quote" class is never instantiated, and simply
15       provides a common abstract base class for the four quote classes.  In
16       PPI, a "quote" is limited to only the quote-like things that themselves
17       directly represent a string. (although this includes double quotes with
18       interpolated elements inside them, note that
19       String::InterpolatedVariables allows to extract them).
20
21       The subclasses of "PPI::Token::Quote" are:
22
23       '' - PPI::Token::Quote::Single
24       "q{}" - PPI::Token::Quote::Literal
25       "" - PPI::Token::Quote::Double
26       "qq{}" - PPI::Token::Quote::Interpolate
27
28       The names are hopefully obvious enough not to have to explain what each
29       class is here. See their respective pages for more details.
30
31       Please note that although the here-doc does represent a literal string,
32       it is such a nasty piece of work that in PPI it is given the honor of
33       its own token class (PPI::Token::HereDoc).
34

METHODS

36   string
37       The "string" method is provided by all four ::Quote classes. It won't
38       get you the actual literal Perl value, but it will strip off the
39       wrapping of the quotes.
40
41         # The following all return foo from the ->string method
42         'foo'
43         "foo"
44         q{foo}
45         qq <foo>
46
47   literal
48       The "literal" method is provided by ::Quote::Literal and
49       ::Quote::Single.  This returns the value of the string as Perl sees it:
50       without the quote marks and with "\\" and "\'" resolved to "\" and "'".
51
52       The "literal" method is not implemented by ::Quote::Double or
53       ::Quote::Interpolate yet.
54

SUPPORT

56       See the support section in the main module.
57

AUTHOR

59       Adam Kennedy <adamk@cpan.org>
60
62       Copyright 2001 - 2011 Adam Kennedy.
63
64       This program is free software; you can redistribute it and/or modify it
65       under the same terms as Perl itself.
66
67       The full text of the license can be found in the LICENSE file included
68       with this module.
69
70
71
72perl v5.38.0                      2023-09-22              PPI::Token::Quote(3)
Impressum