in reply to unsure how to use variable
print "$$tempvar<br>"; #this now prints the colors
Note the extra $ sigil. However, you should probably not do it like this. This type of approach is fragile and generally results in code that is very difficult to debug and/or maintain. The easier and more reliable method, as mentioned above, is to use an array (or hash). Symbolic references are nearly always a bad design decision. For some more, see Why it's stupid to use a variable as a variable name.
|
|---|