J
James E Keenan
From a 1997 posting by Randal L Schwartz on this list, I got the
following code as a way to get a list of all (or most ??) identifiers in
a program at a given point.
print "\n\n" .
Dumper ({
map {
(defined $$_ ? ("\$$_" => $$_) : ()),
(defined @$_ ? ("\@$_" => \@$_) : ()),
(defined %$_ ? ("\%$_" => \%$_) : ()),
} sort keys %{__PACKAGE__."::"}
});
1. Are there any better ways to approach this problem?
2. In addition to package variables, how can I get a list of the
lexical variables declared at a given point in a program? (I think this
means the content of the scratchpad(s)?)
TIA
Jim Keenan
following code as a way to get a list of all (or most ??) identifiers in
a program at a given point.
print "\n\n" .
Dumper ({
map {
(defined $$_ ? ("\$$_" => $$_) : ()),
(defined @$_ ? ("\@$_" => \@$_) : ()),
(defined %$_ ? ("\%$_" => \%$_) : ()),
} sort keys %{__PACKAGE__."::"}
});
1. Are there any better ways to approach this problem?
2. In addition to package variables, how can I get a list of the
lexical variables declared at a given point in a program? (I think this
means the content of the scratchpad(s)?)
TIA
Jim Keenan