B
Babu
Hi,
I am a Perl newbie and have a doubt on Perl exception handling.
My understanding regarding exception handling is execute a piece of
code, if any exception occurs, handle the exception and proceed as if
the error never occurred at all.
So code would look like
Eval {
# do something
}; if ($@)
{
#handle exception
}
#procees as if no exception occurred
But in Perl I find that very often we die upon an exception. We never
try to handle the exception and continue. Is my understanding correct?
Is this the right way to do it?
TIA,
Babu
I am a Perl newbie and have a doubt on Perl exception handling.
My understanding regarding exception handling is execute a piece of
code, if any exception occurs, handle the exception and proceed as if
the error never occurred at all.
So code would look like
Eval {
# do something
}; if ($@)
{
#handle exception
}
#procees as if no exception occurred
But in Perl I find that very often we die upon an exception. We never
try to handle the exception and continue. Is my understanding correct?
Is this the right way to do it?
TIA,
Babu