Krillian has asked for the wisdom of the Perl Monks concerning the following question:
Hi all, Not sure exactly what this is called so cannot find a tutorial. Here is the code:
$a3 = "Hello"; $b = "a"; $c = "3"; $d = "${$b.$c}"; print $d; # $d should be prints as Hello
This works fine, but if I change it a little:
$a[3] = "Hello"; $b = "a"; $c = "[3]"; $d = "${$b.$c}"; print $d; # $d should be prints as Hello
It no longer works...
What am I doing wrong?
Any help would be very much appreciated and thank you very much in advance!
~Kirill
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Combining 2 variable?
by AppleFritter (Vicar) on Aug 31, 2014 at 17:11 UTC | |
|
Re: Combining 2 variable?
by choroba (Cardinal) on Aug 31, 2014 at 12:11 UTC | |
|
Re: Combining 2 variable?
by Laurent_R (Canon) on Aug 31, 2014 at 12:33 UTC | |
|
Re: Combining 2 variable?
by LanX (Saint) on Aug 31, 2014 at 12:46 UTC | |
|
Re: Combining 2 variables?
by Athanasius (Archbishop) on Aug 31, 2014 at 16:00 UTC | |
|
Re: Combining 2 variable?
by davido (Cardinal) on Aug 31, 2014 at 23:48 UTC | |
by LanX (Saint) on Sep 01, 2014 at 00:30 UTC |