Convert scalar variable and its value to hash ref variable's value
<p>Trying to understand why the following does not work:</p>

<pre><code>DB&lt;1&gt; $record = "some value"
DB&lt;2&gt; $record-&gt;{default} = $record;
DB&lt;3&gt; use Data::Dumper
</code></pre>

<p>Would think <code>Dumper</code> should show same results as <strong>step 10</strong>:</p>

<pre><code>DB&lt;4&gt; print Dumper $record
$VAR1 = 'some value';

DB&lt;5&gt; $temp = $record
DB&lt;6&gt; $record-&gt;{default} = $temp
</code></pre>

<p>At least in this case, would surly think <code>Dumper</code> would show results as <strong>step 10</strong>:</p>

<pre><code>DB&lt;7&gt; print Dumper $record
$VAR1 = 'some value';
</code></pre>

<p>Do you really need to force it ?</p>

<pre><code>DB&lt;8&gt; undef $record
DB&lt;9&gt; $record-&gt;{default} = $temp
DB&lt;10&gt; print Dumper $record
$VAR1 = {
          'default' =&gt; 'some value'
        };
</code></pre>

<p>How can I understand/explain why Perl does not "get" what I mean to do?</p>