in reply to variable name
I'm not sure why you want to use that, but there is a way to find the variable names, and that's by checking the symbol table (hash %::) but it contains symbols you don't want... here's an example to filter them out:
$bleh = 1; $var = 3; print join "\n", grep { ! ( /^\*/ || /(::|\W)/ ) } grep { ! /(std(err|out|in)|ARGV|INC|ENV|0|STD(ERR|OUT|IN)|_)/ } keys %::;
So now you have all the variable names in the script (in package main here) but finding out which variable is which it tricky.
--
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: variable name
by polypompholyx (Chaplain) on Jul 22, 2006 at 13:10 UTC |