Download Shareware and Freeware Software for Windows, Linux, Macintosh, PDA

line Home  |  About Us  |  Link To Us  |  FAQ  |  Contact

Serving Software Downloads in 976 Categories, Downloaded 29.876.819 Times

Religion 1.04

  Date Added: May 09, 2010  |  Visits: 581

Religion

Report Broken Link
Printer Friendly Version


Product Homepage
Download (71 downloads)



Religion is a Perl module that can generate tracebacks and create and install die() and warn() handlers. This is a second go at a module to simplify installing die() and warn() handlers, and to make such handlers easier to write and control. For most people, this just means that if use use Religion; then youll get noticably better error reporting from warn() and die(). This is especially useful if you are using eval(). Religion provides four classes, WarnHandler, DieHandler, WarnPreHandler, and DiePreHandler, that when you construct them return closures that can be stored in variables that in turn get invoked by $SIG{__DIE__} and $SIG{__WARN__}. Note that if Religion is in use, you should not modify $SIG{__DIE__} or $SIG{__WARN__}, unless you are careful about invoking chaining to the old handler. Religion also provides a TraceBack function, which is used by a DieHandler after you die() to give a better handle on the current scope of your situation, and provide information about where you were, which might influence where you want to go next, either returning back to where you were, or going on to the very last. [Sorry - Ed.] See below for usage and examples. USAGE DieHandler SUB Invoke like this: $Die::Handler = new DieHandler sub { #... }; where #... contains your handler code. Your handler will receive the following arguments: $message, $full_message, $level, $eval, $iline, $ifile, $oline, $ofile, $oscope $message is the message provided to die(). Note that the default addition of " at FILE line LINE.n" will have been stripped off if it was present. If you want to add such a message back on, feel free to do so with $iline and $ifile. $full_message) is the message with a scope message added on if there was no newline at the end of $message. Currently, this is not the original message that die() tacked on, but something along the lines of " at line 3 of the eval at line 4 of Foo.pln". $eval is non-zero if the die() was invoked inside an eval. The rest of the arguments are explained in the source for Religion::TraceBack. Yes, I need to document these, but not just now, for they are a pain to explain. Whenever you install a DieHandler, it will automatically store the current value of $Die::Handler so it can chain to it. If you want to install a handler only temporarily, use local(). If your handler returns data using return or by falling off the end, then the items returns will be used to fill back in the argument list, and the next handler in the chain, if any, will be invoked. Dont fall off the end if you dont want to change the error message. If your handler exits using last, then no further handlers will be invoked, and the program will die immediatly. If your handler exits using next, then the next handler in the chain will be invoked directly, without giving you a chance to change its arguments as you could if you used return. If your handler invokes die(), then die() will proceed as if no handlers were installed. If you are inside an eval, then it will exit to the scope enclosing the eval, otherwise it will exit the program. WarnHandler SUB Invoke like this: $Warn::Handler = new WarnHandler sub { #... }; For the rest of its explanation, see DieHandler, and subsitute warn() for die(). Note that once the last DieHandler completes (or last is invoked) then execution will return to the code that invoked warn(). DiePreHandler SUB Invoke like this: $Die::PreHandler = new DiePreHandler sub { #... }; This works identically to $Die::Handler, except that it forms a separate chain that is invoked before the DieHandler chain. Since you can use last to abort all the handlers and die immediately, or change the messages or scope details, this can be useful for modifying data that all future handlers will see, or to dispose of some messages from further handling. This is even more useful in $Warn::PreHandler, since you can just throw away warnings that you know arent needed. WarnPreHandler SUB Invoke like this: $Warn::PreHandler = new WarnPreHandler sub { #... }; This works identically to $Warn::Handler, except that it forms a separate chain that is invoked before the WarnHandler chain. Since you can use last to abort all the handlers and return to the program, or change the messages or scope details, this can be useful for modifying data that all future handlers will see, or to dispose of some messages. This is very useful, since you can just throw away warnings that you know arent needed..

Requirements: No special requirements
Platforms: Linux
Keyword: Diehandler Handler If Your Invoked Message Perl Module Religion Sig Sub Want To Warn Warnhandler Warnprehandler Will Be You Want To
Users rating: 0/10

License: Freeware Size: 5.12 KB
USER REVIEWS
More Reviews or Write Review


RELIGION RELATED
Weather  -  Lanka Hub 1.0.0.0
Lanka Hub App is your one-stop shop for all the Sri Lankan news sources. the application will help you navigate to popular news paper and magazine. Requirements: Windows Phone 8.1, Windows Phone 8, Windows Phone 7.5
2 MB  
Games  -  Stone Shooter 1.0.0.2
Huge amount of bombs are falling from the sky and only you can stop them from destroying earth, load your slingshot, aim, shoot and don't let them reaching the ground. ?Who will be the first to hold more than 10 levels? At least 10...
1024 KB  
Libraries  -  Mail::Message::Head::FieldGroup 2.069
Mail::Message::Head::FieldGroup is a Perl module with a sub set of fields in a header. INHERITANCE Mail::Message::Head::FieldGroup is a Mail::Reporter Mail::Message::Head::FieldGroup is extended by Mail::Message::Head::ListGroup...
583.68 KB  
Libraries  -  PDF::Reuse::Tutorial 0.11
PDF::Reuse::Tutorial is a Perl module that will teach you how to produce PDF-files with PDF::Reuse. In this tutorial I will show some aspects of PDF::Reuse, so you should be able to use it in your own programs. Most important is how to produce...
133.12 KB  
Libraries  -  DBIx::Wrapper::Config 0.01
DBIx::Wrapper::Config Perl module allows the use of a configuration file in XML specifying information required to connect to databases using DBIx::Wrapper. This way, your database connection specifications can be kept in one place. Each "db"...
3.07 KB  
Libraries  -  Image::MetaData::JPEG::Structures 0.15
Image::MetaData::JPEG::Structures is a Perl module that describes the structure of a JPEG file; it is an appendix to the main manual page of the Image::MetaData::JPEG module, which the reader should refer to for further details and the general...
286.72 KB  
Libraries  -  Test::TestCoverage 0.05
Test::TestCoverage is Perl module to test if your test covers all public subroutines of the package. SYNOPSIS use Test::TestCoverage; test_coverage(My::Module); my $obj = My::Module->new(); $obj->foo(); $obj->bar(); # test will be ok,...
4.1 KB  
Libraries  -  Alien Perl module 0.91
Alien Perl module package contains external libraries wrapped up for your viewing pleasure! SYNOPSIS perldoc Alien; Alien is a package that exists just to hold together an idea, the idea of Alien:: packages, so there is no code here, just...
10.24 KB  
Libraries  -  dtRdr::Logger 0.0.11
dtRdr::Logger is a Perl module for global logging. SYNOPSIS use dtRdr::Logger; L->debug($message, ...); L->info($message, ...); L->warn($message, ...); L->error($message, ...); L->fatal($message, ...); For a stacktrace: sub bar {...
2.8 MB  
Libraries  -  SOAP::Amazon::S3 0.023
SOAP::Amazon::S3 is a Perl module for interfacing with Amazon S3 through SOAP. SYNOPSIS An object-oriented interface to handle your Amazon S3 storage. (Still experimental, although functional) use SOAP::Amazon::S3; my $s3 =...
5.12 KB  
NEW DOWNLOADS IN PROGRAMMING, LIBRARIES
Programming  -  FLEX-db Digital Asset Manager 3.0.9
FLEX-db - an enterprise Digital Asset Manager (DAM). It ingests and links metadata with files, creates thumbnails, and processes files using business rules. FLEX-db has a JSP client, Java app server for file input and output and an EJB metadata...
21.57 MB  
Programming  -  Libicom 0.9.0
The libicom library is a character based dynamicly linked library for Linux. It is used to remotely control the Icom IC-R8500 wide band receiver via an RS232 link. All call and return parameters to the control functions are character string based....
20.48 KB  
Programming  -  dotdesktop 0.3
Dotdesktop library provides ability to parse desktop entry file and access the information in a convenient way. Desktop entry file format is defined by freedesktop.org, it is used to describe information about an application such as the name and...
327.68 KB  
Programming  -  Cedalion for Linux 0.2.6
Cedalion is a programming language that allows its users to add new abstractions and define (and use) internal DSLs. Its innovation is in the fact that it uses projectional editing to allow the new abstractions to have no syntactic limitations.
471.04 KB  
Programming  -  libyasl 0.2
Libyasl is a C++ class library to easily realize TCP/UDP/Multicast clientsand servers in IPv4 and IPv6 environments under GNU/Linux systems.
143.36 KB  
Libraries  -  wolfSSL 3.11.0
The wolfSSL embedded SSL/TLS library is a lightweight SSL library written in ANSI standard C and targeted for embedded and RTOS environments - primarily because of its small size, speed, and feature set. It is commonly used in standard operating...
2.73 MB  
Libraries  -  EuGTK 4.8.9
Makes it easy to develop good- looking, fast, cross-platform programs that run on Linux, OS X, and Windows. Euphoria is a very fast interpreted/compiled language with straight-forward syntax. EuGTK allows programming in a clean, object-oriented...
10.68 MB  
Libraries  -  Linux User Group Library Manager 1.0
The LUG Library Manager is a project to help Linux User Groups start their own library. A LUG library is helpful to the community at large because it increases access to information, and gives everyone the opportunity to become more knowledgeable.
5.35 KB  
Libraries  -  Module::MakefilePL::Parse 0.12
Module::MakefilePL::Parse is a Perl module to parse required modules from Makefile.PL. SYNOPSIS use Module::MakefilePL::Parse; open $fh, Makefile.PL; $parser = Module::MakefilePL::Parse->new( join("", ) ); $info = $parser->required;...
8.19 KB  
Libraries  -  sqlpp 0.06
sqlpp Perl package is a SQL preprocessor. sqlpp is a conventional cpp-alike preprocessor taught to understand SQL ( PgSQL, in particular) syntax specificities. In addition to the standard #define/#ifdef/#else/#endif cohort, provides also...
10.24 KB