<?xml version="1.0" encoding="windows-1252"?>
<node id="1011428" title="Creating dynamic variables" created="2013-01-03 04:48:00" updated="2013-01-03 04:48:00">
<type id="115">
perlquestion</type>
<author id="979959">
rbala</author>
<data>
<field name="doctext">
Hi ,
I have a small query regarding variable assignments in perl. See the below code.

&lt;code&gt;
$foo = "hello";
my $x = "$foo".$y; # $y is not yet defined.
$y = "world";
print $x;
&lt;/code&gt;
This gives output as only hello, seems the variable $y is not dynamically substituted in $x based on the next assignment &lt;code&gt;$y = world&lt;/code&gt;.
Is there any way to accomplish this like in makefiles we have this type of assignments.
I got this situation when i want to create files dynamically with different names using this type of substitution.
Any help ????
Thanks in Advance!!!</field>
</data>
</node>
