dgoroski has asked for the wisdom of the Perl Monks concerning the following question:
I want the new variable, tempvar in this case, to print what i gave it earlier, the color. however it only prints the words holding1 not the value I want it to have, 'green'. I'm sure I'm missing something simple but i apparently have a lack of knowledge in this area.
$holding1="green"; $holding2="blue"; $holding3="yellow"; for ($count = 3; $count >= 1; $count--) { $tempvar=holding . $count; print "$tempvar<br>"; #this prints holding1 instead of green }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: unsure how to use variable
by toolic (Bishop) on Feb 17, 2012 at 15:33 UTC | |
|
Re: unsure how to use variable
by moritz (Cardinal) on Feb 17, 2012 at 15:31 UTC | |
|
Re: unsure how to use variable
by jethro (Monsignor) on Feb 17, 2012 at 15:44 UTC | |
|
Re: unsure how to use variable
by kennethk (Abbot) on Feb 17, 2012 at 15:44 UTC | |
|
Re: unsure how to use variable
by JavaFan (Canon) on Feb 17, 2012 at 16:04 UTC | |
by Your Mother (Archbishop) on Feb 18, 2012 at 06:11 UTC | |
|
Re: unsure how to use variable
by oko1 (Deacon) on Feb 17, 2012 at 17:02 UTC | |
by tobyink (Canon) on Feb 17, 2012 at 18:14 UTC | |
by oko1 (Deacon) on Feb 18, 2012 at 04:54 UTC | |
|
Re: unsure how to use variable
by dkroft (Sexton) on Feb 17, 2012 at 17:35 UTC |