Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

class::errorhandler(3pm) [debian man page]

Class::ErrorHandler(3pm)				User Contributed Perl Documentation				  Class::ErrorHandler(3pm)

NAME
Class::ErrorHandler - Base class for error handling SYNOPSIS
package Foo; use base qw( Class::ErrorHandler ); sub class_method { my $class = shift; ... return $class->error("Help!") unless $continue; } sub object_method { my $obj = shift; ... return $obj->error("I am no more") unless $continue; } package main; use Foo; Foo->class_method or die Foo->errstr; my $foo = Foo->new; $foo->object_method or die $foo->errstr; DESCRIPTION
Class::ErrorHandler provides an error-handling mechanism that's generic enough to be used as the base class for a variety of OO classes. Subclasses inherit its two error-handling methods, error and errstr, to communicate error messages back to the calling program. On failure (for whatever reason), a subclass should call error and return to the caller; error itself sets the error message internally, then returns "undef". This has the effect of the method that failed returning "undef" to the caller. The caller should check for errors by checking for a return value of "undef", and calling errstr to get the value of the error message on an error. As demonstrated in the SYNOPSIS, error and errstr work as both class methods and object methods. USAGE
Class->error($message) $object->error($message) Sets the error message for either the class Class or the object $object to the message $message. Returns "undef". Class->errstr $object->errstr Accesses the last error message set in the class Class or the object $object, respectively, and returns that error message. LICENSE
Class::ErrorHandler is free software; you may redistribute it and/or modify it under the same terms as Perl itself. AUTHOR &; COPYRIGHT Except where otherwise noted, Class::ErrorHandler is Copyright 2004 Benjamin Trott, cpan@stupidfool.org. All rights reserved. perl v5.8.7 2005-07-20 Class::ErrorHandler(3pm)

Check Out this Related Man Page

Class::Inspector::Functions(3pm)			User Contributed Perl Documentation			  Class::Inspector::Functions(3pm)

NAME
Class::Inspector::Functions - Get information about a class and its structure SYNOPSIS
use Class::Inspector::Functions; # Class::Inspector provides a non-polluting, # method based interface! # Is a class installed and/or loaded installed( 'Foo::Class' ); loaded( 'Foo::Class' ); # Filename related information filename( 'Foo::Class' ); resolved_filename( 'Foo::Class' ); # Get subroutine related information functions( 'Foo::Class' ); function_refs( 'Foo::Class' ); function_exists( 'Foo::Class', 'bar' ); methods( 'Foo::Class', 'full', 'public' ); # Find all loaded subclasses or something subclasses( 'Foo::Class' ); DESCRIPTION
Class::Inspector::Functions is a function based interface of Class::Inspector. For a thorough documentation of the available functions, please check the manual for the main module. Exports The following functions are exported by default. installed loaded filename functions methods subclasses The following functions are exported only by request. resolved_filename loaded_filename function_refs function_exists All the functions may be imported using the ":ALL" tag. SUPPORT
Bugs should be reported via the CPAN bug tracker http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Class-Inspector <http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Class-Inspector> For other issues, or commercial enhancement or support, contact the author. AUTHOR
Adam Kennedy <adamk@cpan.org> Steffen Mueller <smueller@cpan.org> SEE ALSO
<http://ali.as/>, Class::Handle COPYRIGHT
Copyright 2002 - 2012 Adam Kennedy. Class::Inspector::Functions copyright 2008 - 2009 Steffen Mueller. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. The full text of the license can be found in the LICENSE file included with this module. perl v5.14.2 2012-01-25 Class::Inspector::Functions(3pm)
Man Page