Yes. Include a package declaration at the head of your script, then you can get the names of the variables (and subroutines) as follows:
0:51 >perl -E "package Foo; $x = 42; $y = 'fred'; sub command { print + 'Special command'; } say for sort keys %Foo::;" command x y 0:54 >
Hope that helps,
Athanasius <°(((>< contra mundum
In reply to Re^2: Print variable name/value for all program variables
by Athanasius
in thread [SOLVED] - Print variable name/value for all program variables
by VinsWorldcom
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |