August 1997
Intermediate to advanced
432 pages
12h 19m
English
die
throws an
exception, and eval traps it. Error string is
found in $@. The following code has the
possibility of two run-time errors:
eval {
$c = $a / $b; #1
die "Denominator cannot be negative" if ($b < 0); #2
};
print "Run-time error: $@";
$@ can be “Illegal division by zero”
at (1) or “Denominator cannot be negative” at (2).
Read now
Unlock full access