[MOBY-guts] biomoby commit

Dennis Wang dwang at pub.open-bio.org
Wed Jul 20 17:25:54 UTC 2005


dwang
Wed Jul 20 13:25:54 EDT 2005
Update of /home/repository/moby/moby-live/Perl/MOBY
In directory pub.open-bio.org:/tmp/cvs-serv25266/Perl/MOBY

Modified Files:
	authority.pm 
Log Message:
removed explicit call to first row of result set, instead use shift to retrieve first row

moby-live/Perl/MOBY authority.pm,1.4,1.5
===================================================================
RCS file: /home/repository/moby/moby-live/Perl/MOBY/authority.pm,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- /home/repository/moby/moby-live/Perl/MOBY/authority.pm	2005/07/20 15:43:57	1.4
+++ /home/repository/moby/moby-live/Perl/MOBY/authority.pm	2005/07/20 17:25:54	1.5
@@ -91,13 +91,14 @@
 	my $adaptor = $CONFIG->getDataAdaptor( datasource => 'mobycentral' );
 
 	my $result = $adaptor->query_authority({authority_uri => $self->authority_uri});
-	unless (@$result[0]) {
+	my $row = shift(@$result);
+	unless ($row) {
 		my $insertid = $adaptor->insert_authority({authority_common_name => $self->authority_common_name}, 
 		{authority_uri => $self->authority_uri},
 		{contact_email => $self->contact_email});
 		$self->authority_id( $insertid );
 	} else {
-		$self->authority_id(@$result[0]->{authority_id});
+		$self->authority_id($row->{authority_id});
 	}
 	return $self;
 }




More information about the MOBY-guts mailing list