Using eval to evaluate an expression : eval « System Functions « Perl






Using eval to evaluate an expression

     

$x = 1;
$y = 0;
eval {$result = $x / $y};
print "eval says: $@" if $@;

   
    
    
    
    
  








Related examples in the same category

1.Using eval to test whether a function is implemented.
2.The eval command executes a snippet of Perl code
3.Behavior of eval.