title: perl variable substitution in variable name
body: <pre><code>#!/usr/bin/perl
  my $var_a;
  $sub_a = "a";
  $var_a = "a";
  print ${var_."$sub_a"},"\n";
  
  
  $sub_b = "b";
  $var_b = "b";
  print ${var_."$sub_b"},"\n";
  
  __DATA__
  
  b
  </code></pre>
  
  <p>Why is b printed, but not a? This seems like very unexpected behaviour to me.</p>
  
  <p>I'm trying to use a variable with a substituted name. In practice, I cannot just not declare the variable, since the assignment is being done in a forloop and thus has different lexical scope.</p>