An alternative to the other suggestions is to use (s)printf:
You will need to be careful in sanitizing the contents of $str if all or part of it is being taken from user (or otherwise untrusted) input .my $str = 'params.%d.arg'; + for my $idx (0 .. 9 ) { printf $str, $idx; }
/J\
In reply to Re: String interpolation
by gellyfish
in thread String interpolation
by hotshot
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |