Fault::ErrorHandler - A base error handler class.
use Fault::ErrorHandler; $class_object = Fault::ErrorHandler->new; $flg = Fault::ErrorHandler->warn ($msg); $flg = $class_object->warn ($msg); Fault::ErrorHandler->die ($msg); $class_object->die ($msg);
Base Class
This Class does not have instance objects, only a single 'Class Object'. It is always referenced under the Class name. This makes it very easy for code at any level or location within a system to send error messages in a predetermined manner. While this particular class is just a cover for Perl warn and die, one could subclass it to do just about anything..
At the moment this class may seem trivial, however the intention is to add code that will detect and use other methods of warn and die, such as Gtk dialog panels, if they are present. I will impliment that when I find my round tuit(*)
* Round tuits were invented by Paula Shubock of CMU in the early 1980's. The first was a yellow circle with a centered calligraphic 'tuit'!
use Fault::ErrorHandler; my $classobj = Fault::ErrorHandler->new; my $didwarn = Fault::ErrorHandler->warn ("Dont do that!"); my $didwarn = $classobj->warn ("Stop it!"); Fault::ErrorHandler->die ("ARRRGGH!!!"); $classobj->die ("R.I.P");
None.
Generate the ErrorHandler object if it doesn't exist; otherwise just return the existing class object.
Issue the specified warning message and return true if successful. If there is no message, it prints "<Null warning message>".
Issue the specified die message and then commit hari-kari. If there is no message, it prints "<Null warning message>".
See TODO.
Dale Amon <amon@vnl.com>
1 POD Error
The following errors were encountered while parsing the POD:
=back doesn't take any parameters, but you said =back 4
To install Fault::Msg, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Fault::Msg
CPAN shell
perl -MCPAN -e shell install Fault::Msg
For more information on module installation, please visit the detailed CPAN module installation guide.