title: How can I run dynamic code in Perl?
body: <p>I have a question relating to Perl dynamic code. Is there a construct in Perl where I could use to execute code.</p>
  
  <p>For instance,</p>
  
  <pre><code>$command = " some command";
  $perl -&gt; execute($command);
  </code></pre>
  
  <p><code>$command</code> changes in run time . Sorry for my terminology. I do not know how to explain it otherwise.</p>
  
  <p>I am trying to accomplish this: I have a function which execute some command for each reference in a array. </p>
  
  <pre><code> ...insert example call to function...
  </code></pre>
  
  <p>Let's say each reference has an identifier associated. </p>
  
  <pre><code> ...insert sample reference...
   ...say something about how you determine the identifier...
   ...say something about how you want to use the identifier...
  </code></pre>
  
  <p>I can't iterate through the array and execute for every reference since a portion of the command varies for each reference as it has a part of the identifier and there is no exhaustive list of identifiers. For instance if <code>$r0</code> has an identifier 'r0', the command <code>$r0-&gt;test("r0")</code> should be executed.</p>