Maybe you want a templating system instead? sprintf is the simplest one, and it could be used in your case as follows:
$foo = "hello"; my $x = "$foo%s"; my $output = sprintf $x, $y; # replaces "%s" with $y print $output;
There are many, many more templating systems, with varying easy of use and complexity. I recommend looking at simple string substitution first.
In reply to Re: Creating dynamic variables
by Corion
in thread Creating dynamic variables
by rbala
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |