1PPI::Token::Attribute(3U)ser Contributed Perl DocumentatiPoPnI::Token::Attribute(3)
2
3
4

NAME

6       PPI::Token::Attribute - A token for a subroutine attribute
7

INHERITANCE

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

DESCRIPTION

14       In Perl, attributes are a relatively recent addition to the language.
15
16       Given the code " sub foo : bar(something) {} ", the bar(something) part
17       is the attribute.
18
19       A "PPI::Token::Attribute" token represents the entire of the attribute,
20       as the braces and its contents are not parsed into the tree, and are
21       treated by Perl (and thus by us) as a single string.
22

METHODS

24       This class provides some additional methods beyond those provided by
25       its PPI::Token and PPI::Element parent classes.
26
27   identifier
28       The "identifier" attribute returns the identifier part of the
29       attribute.
30
31       That is, for the attribute foo(bar), the "identifier" method would
32       return "foo".
33
34   parameters
35       The "parameters" method returns the parameter string for the attribute.
36
37       That is, for the attribute foo(bar), the "parameters" method would
38       return "bar".
39
40       Returns the parameters as a string (including the null string '' for
41       the case of an attribute such as foo().)
42
43       Returns "undef" if the attribute does not have parameters.
44

SUPPORT

46       See the support section in the main module.
47

AUTHOR

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