title: Perl: can I skip the intermediate hash variable in this case?
body: <p>At the moment, I use something like this:</p>
  
  <pre><code>my %tmpHash = routineReturningHash();
  my $value = $tmpHash{'someKey'};
  </code></pre>
  
  <p>The only thing I need is <code>$value</code>, I do not need <code>%tmpHash</code> itself. So I am curious to know if there is a way to avoid declaring <code>%tmpHash</code>.</p>
  
  <p>I tried</p>
  
  <pre><code>my $value = ${routineReturningHash()}{'someKey'};
  </code></pre>
  
  <p>but it doesn't work and outputs a strange error: "<code>Can't use string ("1/256") as a HASH ref while "strict refs" in use</code>".</p>
  
  <p>Any ideas how it could be done?</p>