G
Griff
Why is it that this code produces a trappable exception -
#--------------------------------
$b = 1;
$c = 0;
eval { $b / $c ; } ;
if ($@)
{
print "I caught an exception\n";
print $@;
}
#--------------------------------
but this code seems to crash without catching the exception -
eval { 1 / 0 ; } ;
if ($@)
{
print "I caught an exception\n";
print $@;
}
I know that the second piece of code is even dumber than the first,
but just wondered what the difference was between the errors produced.
Thanks - Griff
#--------------------------------
$b = 1;
$c = 0;
eval { $b / $c ; } ;
if ($@)
{
print "I caught an exception\n";
print $@;
}
#--------------------------------
but this code seems to crash without catching the exception -
eval { 1 / 0 ; } ;
if ($@)
{
print "I caught an exception\n";
print $@;
}
I know that the second piece of code is even dumber than the first,
but just wondered what the difference was between the errors produced.
Thanks - Griff