I recently read "Object Oriented Exception Handling in Perl" Perl.com article. Is there any point to use exceptions in Perl?
In Object-Oriented Programming (OOP), exceptions are a powerful mechanism for centralized processing of errors and exceptional situations. This mechanism replaces the procedure-oriented method of error handling in which each function returns a code indicating an error or a successful execution.
I should note that the article you referenced is old, and that you should now use Exception::Class instead of Error.pm, which is quirky and tends to break (it's what I call "black magick"). I should note that I am now the Error.pm maintainer, but I no longer recommend it or make use of it for my own code.
"is there any point to use exceptions in Perl?"
Yes, I highly recommend reading the "Error Handling" chapter in Perl Best Practices by Damian Conway.
It certainly opened my eyes ;-)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With