Main > Programming > Libraries >

Exception::Class::TryCatch 1.10

Exception::Class::TryCatch 1.10

Sponsored Links

Exception::Class::TryCatch 1.10 Ranking & Summary

RankingClick at the star to rank
Ranking Level
User Review: 0 (0 times)
File size: 0.015 MB
Platform: Any Platform
License: Perl Artistic License
Price:
Downloads: 1007
Date added: 2007-01-22
Publisher: David A Golden

Exception::Class::TryCatch 1.10 description

Exception::Class::TryCatch is a syntactic try/catch sugar for use with Exception::Class.

SYNOPSIS

use Exception::Class::TryCatch;

# simple usage of catch()

eval { Exception::Class::Base->throw(error) };
catch my $err and warn $err->error;

# catching only certain types or else rethrowing

eval { Exception::Class::Base::SubClass->throw(error) };
catch( my $err, [Exception::Class::Base, Other::Exception] )
and warn $err->error;

# catching and handling different types of errors

eval { Exception::Class::Base->throw(error) };
if ( catch my $err ) {
$err->isa(this) and do { handle_this($err) };
$err->isa(that) and do { handle_that($err) };
}

# use "try eval" to push exceptions onto a stack to catch later

try eval {
Exception::Class::Base->throw(error)
};
do {
# cleanup that might use "try/catch" again
};
catch my $err; # catches a matching "try"

Exception::Class::TryCatch provides syntactic sugar for use with Exception::Class using the familiar keywords try and catch. Its primary objective is to allow users to avoid dealing directly with $@ by ensuring that any exceptions caught in an eval are captured as Exception::Class objects, whether they were thrown objects to begin with or whether the error resulted from die. This means that users may immediately use isa and various Exception::Class methods to process the exception.

In addition, this module provides for a method to push errors onto a hidden error stack immediately after an eval so that cleanup code or other error handling may also call eval without the original error in $@ being lost.

Inspiration for this module is due in part to Dave Rolskys article "Exception Handling in Perl With Exception::Class" in The Perl Journal (Rolsky 2004).

The try/catch syntax used in this module does not use code reference prototypes the way the Error.pm module does, but simply provides some helpful functionality when used in combination with eval. As a result, it avoids the complexity and dangers involving nested closures and memory leaks inherent in Error.pm (Perrin 2003).
Rolsky (2004) notes that these memory leaks may not occur in recent versions of Perl, but the approach used in Exception::Class::TryCatch should be safe for all versions of Perl as it leaves all code execution to the eval in the current scope, avoiding closures altogether.

Exception::Class::TryCatch 1.10 Screenshot

Advertisements

Exception::Class::TryCatch 1.10 Keywords

Bookmark Exception::Class::TryCatch 1.10

Hyperlink code:
Link for forum:

Exception::Class::TryCatch 1.10 Copyright

WareSeeker periodically updates pricing and software information of Exception::Class::TryCatch 1.10 full version from the publisher, so some information may be slightly out-of-date. You should confirm all information before relying on it. Software piracy is theft, Using crack, password, serial numbers, registration codes, key generators is illegal and prevent future development of Exception::Class::TryCatch 1.10 Edition. Download links are directly from our publisher sites, torrent files or links from rapidshare.com, yousendit.com or megaupload.com are not allowed

Allok Video Splitter 2.2.0 Review:

Name (Required)
Email(Required)
Captcha
Featured Software

Want to place your software product here?
Please contact us for consideration.

Contact WareSeeker.com
Related Software
Exception::Class is a Perl module that allows you to declare real exception classes in Perl. Free Download
Exception::Class::TCF is a Java/C++ style exception handling. Free Download
Calendario Class provides a PHP class that is useful for creating calendars and organizers. Free Download
Exception::Base is a Perl module with lightweight exceptions. Free Download
Exception::System is the exception class for system or library calls. Free Download
Class::Contract - Design-by-Contract OO in Perl. Free Download
PHP Greeting card class can be used to compose and send greeting cards by email. Free Download
Class::Generate is a Perl module that can generate Perl class hierarchies. Free Download