Gossamer Forum
Home : General : Perl Programming :

Exception Handling!!

Quote Reply
Exception Handling!!
Hi Everybody,

I just wanted to know whether Perl support any kind of exception handling?

------------------
Manjari Gangwar
Quote Reply
Re: Exception Handling!! In reply to
Yes, you can do it using eval():

eval {
print 3 / 0;
};
if ($@) {
print "Uh oh, fatal error: $@";
}

Hope that helps,

Alex