variables - List the variables in a chunk of Perl
variables eg/variables variables 'qr/foo$bar/smx' variables -help variables -version
This option displays the documentation for this script. The script then exits.
This option displays the version of this script. The script then exits.
This Perl script lists the variables in the chunk of Perl specified as the only command argument. This can be either the name of a file or literal Perl code; the choice is a pragmatic one based on whether a file by the given name actually exists.
The output is in alphabetical order by variable name, and within variable name by sigil. In the case of subscripted variables, the sigil displayed will be that of the underlying variable. That is, if $foo[0] appears, @foo will be displayed.
$foo[0]
@foo
This script will find variables appearing in the code, and variables interpolated into strings. If PPIx::Regexp can be loaded, variables interpolated into regular expressions will also be found.
The heavy lifting is done by PPIx::QuoteLike::Utils subroutine __variables().
NOTE that the __variables() subroutine is discouraged, and may be deprecated and removed.
__variables()
Thomas R. Wyant, III wyant at cpan dot org
Copyright (C) 2019-2020 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.
To install PPIx::QuoteLike, copy and paste the appropriate command in to your terminal.
cpanm
cpanm PPIx::QuoteLike
CPAN shell
perl -MCPAN -e shell install PPIx::QuoteLike
For more information on module installation, please visit the detailed CPAN module installation guide.