in reply to variables names used to define variables
In response to your second question, you don't need to eval. Use what's called a "symbolic reference" and do this:
Check out perlref for more info.# v Assign a variable name to the $result variable my $result = "${input}_def"; return $$result if (defined ($$result)); # ^dereferencing return $input
BUT (big but...) you should be using "real" or "hard" references. Because in general, Symbolic refernces are just a bit too much power for us mortals to handle, because you can muck stuff up so easily. Check out perlref again, but this time look for hard references info. The truth is, you could do all of this with a hash and references. Good luck!
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: variables names used to define variables
by mugwumpjism (Hermit) on Dec 11, 2003 at 06:35 UTC |