package Bio::DB::Das::Chado; use strict; use Bio::Root::Root; use vars qw(@ISA); @ISA = qw(Bio::Root::Root); sub new { my $class = shift; my $self = $class->SUPER::new(@_); # do some work here to extract a DBI $hashref my $cvterm_id; # this scalar is going to be a hashref while (my $hashref = $sth->fetchrow_hashref) { $$cvterm_id{$$hashref{termname}} = $$hashref{cvterm_id}; } return bless {dbh => $dbh, cvterm_id => $cvterm_id}, ref $self ||$self; } sub segment { my $self = shift; my ($name,$start,$end,$class,$version) = $self->_rearrange([qw(NAME START END CLASS VERSION)],@_); # _rearrange is in Bio::Root::Root; I'm allowed to use it # lets the Segment class handle all the lifting. return $self->Bio::DB::Das::Chado::Segment->new($name,$self,$start,$end); } 1;