in reply to How can I turn a string into a variable name?
In theory, you could write
print "Option $string was used\n" if ( eval "\$$string" );
But, as already said, don't. eval in this context is definitely worse than using a hash, in almost every regard.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: How can I turn a string into a variable name?
by ikegami (Patriarch) on Jan 09, 2010 at 20:08 UTC | |
by almut (Canon) on Jan 09, 2010 at 20:21 UTC |