1PPIx::QuoteLike::Token:U:sIenrteCropnotlraitbiuotne(d3P)PPeIrxl::DQoucoutmeeLnitkaet:i:oTnoken::Interpolation(3)
2
3
4
6 PPIx::QuoteLike::Token::Interpolation - Represent an interpolation
7
9 This class should not be instantiated by the user. See below for public
10 methods.
11
13 "PPIx::QuoteLike::Token::Interpolation" is a PPIx::QuoteLike::Token.
14
15 "PPIx::QuoteLike::Token::Interpolation" has no descendants.
16
18 This Perl class represents an interpolation into a quote-like string.
19
21 This class supports the following public methods in addition to those
22 of its superclass:
23
24 ppi
25 my $ppi = $elem->ppi();
26
27 This convenience method returns the PPI::Document representing the
28 content. This document should be considered read only. An exception
29 will be thrown if PPI::Document can not be loaded.
30
31 Note that the content of the returned PPI::Document may not be the same
32 as the content of the original "PPIx::Regexp::Token::Interpolation".
33 This can happen because interpolated variable names may be enclosed in
34 curly brackets, but this does not happen in normal code. For example,
35 in "/${foo}bar/", the content of the
36 "PPIx::Regexp::Token::Interpolation" object will be '${foo}', but the
37 content of the "PPI::Document" will be '$foo'.
38
39 variables
40 say "Interpolates $_" for $elem->variables();
41
42 This convenience method returns all interpolated variables. Each is
43 returned only once, and they are returned in no particular order.
44
45 NOTE that this method is discouraged, and may well be deprecated and
46 removed. My problem with it is that it returns variable names rather
47 than PPI::Element objects, leaving you no idea how the variables are
48 used. It was originally written for the benefit of
49 Perl::Critic::Policy::Variables::ProhibitUnusedVarsStricter, but has
50 proven inadequate to that policy's needs.
51
53 PPIx::QuoteLike::Token.
54
56 Support is by the author. Please file bug reports at
57 <https://github.com/trwyant/perl-PPIx-QuoteLike/issues>, or in
58 electronic mail to the author.
59
61 Thomas R. Wyant, III wyant at cpan dot org
62
64 Copyright (C) 2016-2021 by Thomas R. Wyant, III
65
66 This program is free software; you can redistribute it and/or modify it
67 under the same terms as Perl 5.10.0. For more details, see the full
68 text of the licenses in the directory LICENSES.
69
70 This program is distributed in the hope that it will be useful, but
71 without any warranty; without even the implied warranty of
72 merchantability or fitness for a particular purpose.
73
74
75
76perl v5.32.1 2021-P0P2I-x0:5:QuoteLike::Token::Interpolation(3)