PPI::Token::Symbol - A token class for symbols of various types
PPI::Token::Word isa PPI::Token isa PPI::Element
The PPI::Token::Symbol class is used to cover all tokens that represent variables and other things that start with a sigil.
PPI::Token::Symbol
This class has sevelal methods beyond what is provided by its PPI::Token and PPI::Element parent classes.
Most are provided to help work out what the object is actually pointing at, rather than what it might appear to be pointing at.
The canonical method returns a normalized, canonical version of the symbol.
canonical
For example, it converts $ ::foo'bar::baz to $main::foo::bar::baz.
$ ::foo'bar::baz
$main::foo::bar::baz
This does not fully resolve the symbol, but merely removes syntax variations.
The symbol method returns the ACTUAL symbol this token refers to.
symbol
A token of $foo might actually be refering to @foo, if it is found in the form $foo[1].
$foo
@foo
$foo[1]
This method attempts to resolve these issues to determine the actual symbol.
Returns the symbol as a string.
The raw_type method returns the apparent type of the symbol in the form of it's sigil.
raw_type
Returns the sigil as a string.
The symbol_type method returns the actual type of the symbol in the form of it's sigil.
symbol_type
See the support section in the main module
Adam Kennedy, http://ali.as/, cpan@ali.as
Copyright (c) 2004 - 2005 Adam Kennedy. All rights reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
The full text of the license can be found in the LICENSE file included with this module.
To install PPI, copy and paste the appropriate command in to your terminal.
cpanm
cpanm PPI
CPAN shell
perl -MCPAN -e shell install PPI
For more information on module installation, please visit the detailed CPAN module installation guide.