bioperl-live TestObject
SummaryIncluded librariesPackage variablesDescriptionGeneral documentationMethods
Toolbar
WebCvsRaw content
Summary
TestObject - An implementation of TestInterface
Package variables
No package variables defined.
Included modules
Bio::Root::Root
TestInterface
Inherit
Bio::Root::Root TestInterface
Synopsis
No synopsis!
Description
This module attempts to provide an implementation of TestInterface and
is used for illustrating exception throwing using Graham Barr's
Error.pm object.
Methods
bar
No description
Code
data
No description
Code
Methods description
None available.
Methods code
bardescriptionprevnextTop
sub bar {
    my $self = shift;

    print "\nExecuting method bar() in TestObject\n";
    print "Throwing a Bio::TestException\n";

    my $message = "A Test error";

    # Bio::Root::Root::throw() will make use of Error.pm if present.
# The type of Error is specified with a -class parameter.
# If -class is not supplied, a Bio::Root::Exception is throw.
# In this case, the argument can consist of a simple string.
$self->throw( -class => 'Bio::TestException', -text => $message ); print "Code within bar() below the throw that shouldn't be executed.\n"; } 1;
}
datadescriptionprevnextTop
sub data {
    my ($self, $data) = @_;
    print "Setting test data ($data)\n" if $data;
    $self->{'data'} = $data if $data;
 
   return $self->{'data'}
}
General documentation
AUTHORTop
Steve Chervitz <sac@bioperl.org>