title: Perl eval command not working as expected
body: <p>I have a sort of perl "terminal" (<a href="http://pastebin.com/xwp48zVy" rel="nofollow">pastebin code</a>) we'll call it that I've written, the idea behind writing it is I wanted to run perl code line by line, allowing me to run new commands on existing (large) data sets, without having to change a script and reload the data set and re-run my script.</p>
  
  <p>(Mind you, I wrote this almost a year ago now, and it was mostly a learning experiment (with a dynamic function tablet), however now I have some use for it and discovered some issues which are preventing me from utilising it.)</p>
  
  <p>As such, I <code>eval</code> user entered commands, however, they aren't behaving as expected and perhaps someone can shed some light on why this would be.</p>
  
  <p>This is the 'important' bit, I have the command line data stored in <code>@args</code>, and the first element of that is stored in <code>$prog</code>. I check if there's an existing function (I allow users to create functions, and really abuse references to get an action table) if not I try and eval the command.</p>
  
  <pre><code>if(exists($actions{$prog})){
          print "\n";
          $actions{$prog}-&gt;(@args);
          print "\n";
  }else{
          print "\nEVALing '$command'\n";
          eval $command;
          warn $@ if $@;
          print "\n";
  }
  </code></pre>
  
  <p>As can be seen below, it works as expected for the assignment of scalars, but fails with the assignment of arrays and hashes.</p>
  
  <pre><code>user@host:~/$ perl term.pl 
  1358811935&gt;$a = 0;
  EVALing '$a = 0;'
  
  1358811937&gt;print $a;
  EVALing 'print $a;'
  0
  1358811944&gt;@b = qw(2 3);                                                                                                      
  EVALing '@b = qw(2 3);'
  Global symbol "@b" requires explicit package name at (eval 5) line 1.
  
  1358811945&gt;print @b;
  EVALing 'print @b;'
  Global symbol "@b" requires explicit package name at (eval 6) line 1.
  
  1358812008&gt;my @b = qw(2 3);                                                                                                   
  EVALing 'my @b = qw(2 3);'
  
  1358812008&gt;print "@b";
  EVALing 'print "@b";'
  Possible unintended interpolation of @b in string at (eval 9) line 1.
  Global symbol "@b" requires explicit package name at (eval 9) line 1.
  
  1358812016&gt;print join(',',@b);                                                                                                
  EVALing 'print join(',',@b);'
  Global symbol "@b" requires explicit package name at (eval 10) line 1.
  
  1358812018&gt;
  </code></pre>