<p>Simple question:</p>

<p>How do I do this on one line:</p>

<pre><code>my $foo = $bar-&gt;{baz};
fizz(\$foo);
</code></pre>

<p>I've tried \$bar->{baz}, \${$bar->{baz}}, and numerous others.  Is this even possible?</p>

<p>-fREW</p>

<p><strong>Update</strong>: Ok, the hashref is coming from DBI and I am passing the scalar ref into template toolkit.  I guess now that I look more closely the issue is something to do with how TT does all of this.  Effectively I want to say:</p>

<pre><code>$template-&gt;process(\$row-&gt;{body}, $data);
</code></pre>

<p>But TT doesn't work that way, TT takes a scalar ref and puts the data there, so I'd have to do this:</p>

<pre><code>$template-&gt;process(\$row-&gt;{body}, $shopdata, \$row-&gt;{data});
</code></pre>

<p>Anyway, thanks for the help.  I'll at least only have one reference instead of two.</p>

I am not even sure what you are doing.
You also should put quotes around baz.
Now let's consider that you assign a scalar to the scalar in the first line then the second line should work.
However I don't really know if this is what you are trying here and it does not really make sense in Perl.
Using references is often used in other languages to
speed up a function call
allow multiple values to be returned.
Now the first is usually not needed with scalars and anyway Perl is a script language so if you are really concerned about speed write C.
The second is not needed in Perl as you can return lists and references to anonymous hashes quite easy.
Have you looked at "man perlref"?