in reply to Using a variable to define a variable
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.
|
|---|