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.
In reply to Re: How can I turn a string into a variable name?
by almut
in thread How can I turn a string into a variable name?
by mnooning
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |