Fatal::Exception

Fatal::Exception - succeed or throw exception.
Download

Fatal::Exception Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Perl Artistic License
  • Price:
  • FREE
  • Publisher Name:
  • Piotr Roszatycki
  • Publisher web site:
  • http://search.cpan.org/~dexter/MooseX-GlobRef-Object-0.02/lib/MooseX/GlobRef/Object.pm

Fatal::Exception Tags


Fatal::Exception Description

Fatal::Exception - succeed or throw exception. Fatal::Exception - succeed or throw exception.SYNOPSIS use Fatal::Exception 'Exception::System' => qw; open FILE, "/nonexistent"; # throw Exception::System use Exception::Base 'Exception::My'; sub juggle { ... } import Fatal::Exception 'Exception::My' => 'juggle'; juggle; # succeed or throw exception unimport Fatal::Exception 'juggle'; juggle or die; # restore original behaviorFatal::Exception provides a way to conveniently replace functions which normally return a false value when they fail with equivalents which raise exceptions if they are not successful. This is the same as Fatal module but it throws Exception::Base object on error.IMPORTSuse Fatal::Exception Exception => function, function, ...Replaces the original functions with wrappers which provide do-or-throw equivalents. You may wrap both user-defined functions and overridable CORE operators (except exec, system which cannot be expressed via prototypes) in this way.If the symbol :void appears in the import list, then functions named later in that import list raise an exception only when these are called in void context.You should not fatalize functions that are called in list context, because this module tests whether a function has failed by testing the boolean truth of its return value in scalar context.If the exception class is not exist, its module is loaded with "use Exception" automatically.unimport Fatal::Exception function, function, ...Restores original functions for user-defined functions or replaces the functions with do-without-die wrappers for CORE operators.In fact, the CORE operators cannot be restored, so the non-fatalized alternative is provided instead.The functions can be wrapped and un-wrapped all the time. Requirements: · Perl · Exception::Base · Exception::System


Fatal::Exception Related Software