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).
19
20       The subclasses of "PPI::Token::Quote" are:
21
22       '' - PPI::Token::Quote::Single
23       "q{}" - PPI::Token::Quote::Literal
24       "" - PPI::Token::Quote::Double
25       "qq{}" - PPI::Token::Quote::Interpolate
26
27       The names are hopefully obvious enough not to have to explain what each
28       class is here. See their respective pages for more details.
29
30       Please note that although the here-doc does represent a literal string,
31       it is such a nasty piece of work that in PPI it is given the honor of
32       its own token class (PPI::Token::HereDoc).
33

METHODS

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

SUPPORT

55       See the support section in the main module.
56

AUTHOR

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