title: Perl Setting Value of Constant to value of Hash Key
body: <p>Is there any way to set the value of a Perl Constant to a value in a Perl Hash?</p>
  
  <p>This is not working:</p>
  
  <pre><code>use constant TEST =&gt; $configData{'key'};
  print TEST."\n";
  </code></pre>
  
  <p>This prints just the newline character.</p>
  
  <p>Is this a misuse of the concept of a Constant? The values are still known at compile time, they just do not live inside a perl module or the perl script itself.</p>