I am trying to set a variable like this
puts [lindex $bar 0] # prints bar0
set foo $[lindex $bar 0]_someString
But printing the foo variable not getting the value in foo:
puts $foo # prints $bar0_someString
# but I want the value in bar0_someString varialbe
# not the variable name.
Is this a syntax error? Is it a bad coding style to declare a variable? Is there a better way to do this?