NAME

PPIx::QuoteLike::Utils - Utility subroutines for PPIx::QuoteLike;

SYNOPSIS

use PPIx::QuoteLike::Utils qw{ __variables };

say for __variables( PPI::Document->new( \'$foo' );

DESCRIPTION

This Perl module holds code for PPIx::QuoteLike that did not seem to fit anywhere else.

SUBROUTINES

This module supports the following public subroutines:

__variables

say for __variables( PPI::Document->new( \'$foo' );

Despite the leading underscores, this exportable subroutine is public and supported. The underscores are so it will not appear to be public code to various tools when imported into other code.

This subroutine takes as its only argument a PPI::Node, and returns the names of all variables found in that node, in no particular order. Scope is not taken into account.

In addition to reporting variables parsed as such by PPI, and various corner cases such as ${]} where PPI is blind to the use of the variable, this subroutine looks inside the following PPI classes:

PPI::Token::Quote
PPI::Token::QuoteLike::Backtick
PPI::Token::QuoteLike::Command
PPI::Token::QuoteLike::Readline
PPI::Token::HereDoc

If PPIx::Regexp is installed, it will also look inside

PPI::Token::QuoteLike::Regexp
PPI::Token::Regexp::Match
PPI::Token::Regexp::Substitute

Unfortunately I can not make PPIx::Regexp a requirement for this module, because of the possibility of a circular dependency.

SUPPORT

Support is by the author. Please file bug reports at http://rt.cpan.org, or in electronic mail to the author.

AUTHOR

Thomas R. Wyant, III wyant at cpan dot org

COPYRIGHT AND LICENSE

Copyright (C) 2016-2018 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.