title: Calling another function through eval by passing arguments in Perl
body: <p>I have written the following code for passing arguments to eval function in sample.pl and calling the function in another Perl file sample1.pl.</p>
  
  <p>sample1.pl:</p>
  
  <pre><code>use strict;
  use warnings;
  require 'sample.pl';
  use subs "hello";
  my $main2 = hello();
  sub hello
   {
     print "Hello World!\n";
      our $a=10;
      our $b=20;
      my $str="sample.pl";
      my $xc=eval "sub{$str($a,$b)}";
   }
  </code></pre>
  
  <p>Sample.pl</p>
  
  <pre><code>use strict;
  use warnings;
  our $a;
  our $b;
  use subs "hello_world";
  my $sdf=hello_world();
  sub hello_world($a,$b)
   { 
      print "Hello World!\n";
      our $c=$a+$b;   
      print "This is the called function from sample !\n";
      print "C: " .$c;
  
   } 1;
  </code></pre>
  
  <p>I am getting output as: </p>
  
  <pre><code>Illegal character in prototype for main::hello_world : $a,$b at D:/workspace/SamplePerl_project/sample.pl line 6.
  Use of uninitialized value $b in addition (+) at D:/workspace/SamplePerl_project/sample.pl line 9.
  Use of uninitialized value $a in addition (+) at D:/workspace/SamplePerl_project/sample.pl line 9.
  Hello World!
  This is the called function from sample !
  C: 0Hello World!
  </code></pre>
  
  <p>can u guys show me a solution for this how to call a function through eval by passing arguments</p>