Christopher Charles Cavnor > Class-AutoClass-0.093 > Class::AutoClass::Root



Annotate this POD


New  1
Open  1
View/Report Bugs
Module Version: 1   Source  



SYNOPSIS # Here's how to throw and catch an exception using the eval-based syntax. ^

  $obj->throw("This is an exception");

  eval {
      $obj->throw("This is catching an exception");

  if( $@ ) {
      print "Caught exception";
  } else {
      print "no exception";

DESCRIPTION This class provides some basic functionality for Class::* classes. ^

This package is borrowed from bioperl project ( Because of the formidable size of the bioperl library, is included here with modifications. These modifications were to pare its functioanlity down for its simple job here (removing routines that are out of context and removing references to bioperl to avoid confusion).

Functions originally from Steve Chervitz of bioperl. Refactored by Ewan Birney of bioperl. Re-refactored by Lincoln Stein of bioperl.

Throwing Exceptions

One of the functionalities that Class::AutoClass::Root provides is the ability to throw() exceptions with pretty stack traces.


contact: Chris Cavnor ->


The rest of the documentation details each of the object methods. Internal methods are usually preceded with a _


 Purpose   : generic instantiation function can be overridden if 
             special needs of a module cannot be done in _initialize


 Title   : verbose
 Usage   : $self->verbose(1)
 Function: Sets verbose level for how ->warn behaves
           -1 = no warning
            0 = standard, small warning
            1 = warning with stack trace
            2 = warning becomes throw
 Returns : The current verbosity setting (integer between -1 to 2)
 Args    : -1,0,1 or 2


 Title   : throw
 Usage   : $obj->throw("throwing exception message")
 Function: Throws an exception, which, if not caught with an eval brace
           will provide a nice stack trace to STDERR with the message
 Returns : nothing
 Args    : A string giving a descriptive error message


 Title   : stack_trace
 Usage   : @stack_array_ref= $self->stack_trace
 Function: gives an array to a reference of arrays with stack trace info
           each coming from the caller(stack_number) call
 Returns : array containing a reference of arrays
 Args    : none


 Title   : _stack_trace_dump
 Usage   :
 Example :
 Returns : 
 Args    :


 Title   : deprecated
 Usage   : $obj->deprecated("Method X is deprecated");
 Function: Prints a message about deprecation 
           unless verbose is < 0 (which means be quiet)
 Returns : none
 Args    : Message string to print to STDERR


 Title   : warn
 Usage   : $object->warn("Warning message");
 Function: Places a warning. What happens now is down to the
           verbosity of the object  (value of $obj->verbose) 
            verbosity 0 or not set => small warning
            verbosity -1 => no warning
            verbosity 1 => warning with stack trace
            verbosity 2 => converts warnings into throw
 Example :
 Returns : 
 Args    :


 Title   : debug
 Usage   : $obj->debug("This is debugging output");
 Function: Prints a debugging message when verbose is > 0
 Returns : none
 Args    : message string(s) to print to STDERR
syntax highlighting: