GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
PPIx::QuoteLike::Token(3) User Contributed Perl Documentation PPIx::QuoteLike::Token(3)

PPIx::QuoteLike::Token - Represent any token.

This is an abstract class, and should not be instantiated by the user.

This Perl module represents the base of the token hierarchy.

"PPIx::QuoteLike::Token" is not descended from any other class.

"PPIx::QuoteLike::Token" is the parent of PPIx::QuoteLike::Token::Control, PPIx::QuoteLike::Token::Interpolation, PPIx::QuoteLike::Token::String, PPIx::QuoteLike::Token::Structure, PPIx::QuoteLike::Token::Unknown and PPIx::QuoteLike::Token::Whitespace.

This class supports the following public methods:

This method returns the column number of the first character in the element, or "undef" if that can not be determined.

 say $token->content();

This method returns the text that makes up the token.

 say $token->error();

This method returns the error text. This will be "undef" unless the token actually represents an error.

This method returns the line number of the first character in the element, or "undef" if that can not be determined.

This method returns a reference to an array describing the position of the element in the string, or "undef" if the location is unavailable.

The array is compatible with the corresponding PPI::Element method.

This method returns the logical file name (taking "#line" directives into account) of the file containing first character in the element, or "undef" if that can not be determined.

This method returns the logical line number (taking "#line" directives into account) of the first character in the element, or "undef" if that can not be determined.

 my $parent = $token->parent();

This method returns the token's parent, which will be the PPIx::QuoteLike object that contains it.

 my $next = $token->next_sibling();

This method returns the token after the invocant, or nothing if there is none.

This method returns the version of Perl in which the element was introduced. This will be at least 5.000. Before 5.006 I am relying on the perldelta, perlre, and perlop documentation, since I have been unable to build earlier Perls. Since I have found no documentation before 5.003, I assume that anything found in 5.003 is also in 5.000.

Since this all depends on my ability to read and understand masses of documentation, the results of this method should be viewed with caution, if not downright skepticism.

There are also cases which are ambiguous in various ways. For those see "RESTRICTIONS" in PPIx::Regexp, and especially "Changes in Syntax" in PPIx::Regexp.

This method returns the version of Perl in which the element was removed. If the element is still valid the return is "undef".

All the caveats to perl_version_introduced() apply here also, though perhaps less severely since although many features have been introduced since 5.0, few have been removed.

 my $prev = $token->previous_sibling();

This method returns the token before the invocant, or nothing if there is none.

 $token->significant()
     and say 'significant';

This Boolean method returns a true value if the token is significant, and a false one otherwise.

 my $next = $token->snext_sibling();

This method returns the significant token after the invocant, or nothing if there is none.

 my $prev = $token->sprevious_sibling();

This method returns the significant token before the invocant, or nothing if there is none.

This method returns the PPI::Statement that contains this token, or nothing if the statement can not be determined.

In general this method will return something only under the following conditions:

  • The token is contained in a PPIx::QuoteLike object;
  • That object was initialized from a PPI::Element;
  • The PPI::Element is contained in a statement.

This method returns the top of the hierarchy.

 say "Interpolates $_" for $elem->variables();

NOTE that this method is discouraged, and may well be deprecated and removed. My problem with it is that it returns variable names rather than PPI::Element objects, leaving you no idea how the variables are used. It was originally written for the benefit of Perl::Critic::Policy::Variables::ProhibitUnusedVarsStricter, but has proven inadequate to that policy's needs.

This convenience method returns all interpolated variables. Each is returned only once, and they are returned in no particular order.

NOTE that because this class does not represent an interpolation, this method returns nothing.

This method returns the visual column number (taking tabs into account) of the first character in the element, or "undef" if that can not be determined.

PPIx::QuoteLike.

Support is by the author. Please file bug reports at <https://rt.cpan.org/Public/Dist/Display.html?Name=PPIx-QuoteLike>, <https://github.com/trwyant/perl-PPIx-QuoteLike/issues>, or in electronic mail to the author.

Thomas R. Wyant, III wyant at cpan dot org

Copyright (C) 2016-2022 by Thomas R. Wyant, III

This program is free software; you can redistribute it and/or modify it under the same terms as Perl 5.10.0. For more details, see the full text of the licenses in the directory LICENSES.

This program is distributed in the hope that it will be useful, but without any warranty; without even the implied warranty of merchantability or fitness for a particular purpose.

2022-03-17 perl v5.32.1

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.