rbala has asked for the wisdom of the Perl Monks concerning the following question:
This gives output as only hello, seems the variable $y is not dynamically substituted in $x based on the next assignment $y = world. 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!!!$foo = "hello"; my $x = "$foo".$y; # $y is not yet defined. $y = "world"; print $x;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Creating dynamic variables
by Corion (Patriarch) on Jan 03, 2013 at 09:52 UTC | |
|
Re: Creating dynamic variables
by flexvault (Monsignor) on Jan 03, 2013 at 10:59 UTC | |
|
Re: Creating dynamic variables
by tobyink (Canon) on Jan 03, 2013 at 15:06 UTC | |
|
Re: Creating dynamic variables
by Anonymous Monk on Jan 03, 2013 at 10:29 UTC |