How to assign a value to a symbol given the name in a string
<p>Given the name of a symbol in a string, how can one assign a value to it, more than once?  For example, suppose I want to define a symbol whose name is the value of <code>varname</code> and I want to assign it a value:</p>

<pre><code>varname = "foo"
Symbol[varname]=5
</code></pre>

<p>That does not work because Mathematica thinks you are trying to assign a value to Symbol, which is protected.  This will work if <code>foo</code> is undefined:</p>

<pre><code>Evaluate[Symbol[varname]]=5
</code></pre>

<p>Ok.  But it will not work a second time:</p>

<pre><code>Evaluate[Symbol[varname]]=6
</code></pre>

<p>When the left hand side is evaluated it evaluates to 5 and Mathematica complains that you are trying to assign the value 6 to the raw object 5.  I want to access the symbol <code>foo</code> on the left hand side of the assignment, not the value of <code>foo</code>.  Can this be done?</p>

<p>Thanks in advance for any help you can provide.</p>