programming-examples/perl/SystemFunction/Using eval to evaluate an expression.pl

4 lines
73 B
Perl
Raw Normal View History

2019-11-15 12:59:38 +01:00
$x = 1;
$y = 0;
eval {$result = $x / $y};
print "eval says: $@" if $@;