Lexical-Failure
Lexical-failure
https://metacpan.org/release/Lexical-Failure
Perl module for user-selectable lexically-scoped failure signaling
Lexical::Failure sets up two new keywords: fail and ON_FAILURE, with which you can quickly create modules whose failure signaling is lexcially scoped, under the control of client code.
Normally, modules specify some fixed mechanism for error handling and require client code to adapt to that policy. One module may signal errors by returning undef, or perhaps some special "error object". Another may die or croak on failure. A third may set a flag variable. A fourth may require the client code to set up a callback, which is executed on failure.
If you are using all four modules, your own code now has to check for failure in four different ways, depending on where the failing component originated. If you would rather that all components throw exceptions, or all return undef, you will probably have to write wrappers around 3/4 of them, to convert from their "native" failure mechanism to your preferred one.
Download
Categories
Licensing
License
Verified by
Verified on
Notes
License
Verified by
Debian: Salvatore Bonaccorso <carnil@debian.org>
Verified on
3 May 2014
Notes
License: artistic or gpl-1+
Leaders and contributors
Contact(s) | Role |
---|---|
Damian Conway | contact |
Resources and communication
Audience | Resource type | URI |
---|---|---|
Perl (Ref) | https://metacpan.org/release/Lexical-Failure | |
Debian (Ref) (R) | https://tracker.debian.org/pkg/liblexical-failure-perl |
Software prerequisites
Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.3 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is included in the page “GNU Free Documentation License”.
The copyright and license notices on this page only apply to the text on this page. Any software or copyright-licenses or other similar notices described in this text has its own copyright notice and license, which can usually be found in the distribution or license text itself.