in reply to Is it possible to get all variable names which are declared?

Try something like this:
for(keys %{'main::'}){if(defined $$_){print "\$$_\n\t$$_\n"}}

Replies are listed 'Best First'.
Re^2: Is it possible to get all variable names which are declared?
by Laurent_R (Canon) on Nov 09, 2017 at 18:56 UTC
    Looking into the symbol table like that would attempt to access the "global" (package) variables (those defined with our, for example), not to lexical variables (defined with my), which is apparently what the OP was looking for.