Possible? Yes:
$foobar = 'yes'; $key = 'bar'; print ${'foo'.$key};
But don't do that. There is always a better way to do whatever you're trying to do. If you use strict as you always should, it won't let you.
Aaron B.
Available for small or large Perl jobs and *nix system administration; see my home node.
In reply to Re: Using a variable to define a variable
by aaron_baugher
in thread Using a variable to define a variable
by insta.gator
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |