perlquestion
hotshot
Hi all,<BR><BR>
I have a string defined as follows: <CODE>
my $str = 'params.$idx.arg';
</CODE>
<I>$idx</I> will be assigned with integer values in a loop as follows: <CODE>
for my $idx (0..10) {
&do_something($str);
}
</CODE>
The thing is that I want <I>$str</I> in the loop to be interpulated with the value of <I>$idx</I> in each loop iteration (the above code will not take there of course), meaning <I>do_something()</I> will get a different parameter each loop iteration ('params.0.arg', 'params.1.arg', etc.).<BR>
How can I achive that?<BR><BR>
Thanks
<p><small>Retitled by [davido]: Corrected spelling of 'interpolation' to improve searchability.</small></p>
<!-- Node text goes above. Div tags should contain sig only -->
<div class="pmsig"><div class="pmsig-126161">
<BR><BR>
<A HREF="/index.pl?node=Hotshot&lastnode_id=1072">Hotshot</A>
</div></div>