[MOBY-guts] biomoby commit

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


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

Modified Files:
	Central.pm 
Log Message:
removed calls to first row of the result set (like @$result[0]), instead used shift to retrieve the first row of the result set

moby-live/Perl/MOBY Central.pm,1.162,1.163
===================================================================
RCS file: /home/repository/moby/moby-live/Perl/MOBY/Central.pm,v
retrieving revision 1.162
retrieving revision 1.163
diff -u -r1.162 -r1.163
--- /home/repository/moby/moby-live/Perl/MOBY/Central.pm	2005/07/20 15:43:57	1.162
+++ /home/repository/moby/moby-live/Perl/MOBY/Central.pm	2005/07/20 17:12:20	1.163
@@ -763,7 +763,8 @@
 	my $dbh = MOBY::central_db_connection->new()->dbh;
 	
 	my $result = $adaptor->query_service_instance({service_type_uri => $existingURI});
-	my $id = @$result[0]->{service_instance_id};
+	my $row = shift(@$result);
+	my $id = $row->{service_instance_id};
 	
 	return &_error( "A registered service depends on this service type", "" )
 	  if ($id);
@@ -1938,7 +1939,8 @@
 		  && _LOG("authURI added; criterion count is now $criterion_count\n");
 		 
 		my $result = $adaptor->query_authority({authority_uri => $findme{authURI}}, 'or', {authority_common_name => $findme{authURI}}); 
-		my $id = @$result[0]->{authority_id};
+		my $row = shift(@$result);
+		my $id = $row->{authority_id};
   
 		unless ($id) {
 			return &_serviceListResponse( $dbh, undef );
@@ -3368,16 +3370,17 @@
 
 	foreach (@ids) {
 		my $result = $adaptor->query_service_instance({service_instance_id => $_});
-		my $category = @$result[0]->{category};
-		my $url = @$result[0]->{url};
-		my $servicename = @$result[0]->{servicename};
-		my $service_type_uri = @$result[0]->{service_type_uri};
-		my $authority_id = @$result[0]->{authority_id};
-		my $desc = @$result[0]->{description};
-		my $authoritative = @$result[0]->{authoritative};
-		my $email = @$result[0]->{contact_email};
-		my $signatureURL = @$result[0]->{signatureURL};
-		my $lsid = @$result[0]->{lsid};
+		my $row = shift(@$result);
+		my $category = $row->{category};
+		my $url = $row->{url};
+		my $servicename = $row->{servicename};
+		my $service_type_uri = $row->{service_type_uri};
+		my $authority_id = $row->{authority_id};
+		my $desc = $row->{description};
+		my $authoritative = $row->{authoritative};
+		my $email = $row->{contact_email};
+		my $signatureURL = $row->{signatureURL};
+		my $lsid = $row->{lsid};
 		
 		if ( $desc =~ /<!\[CDATA\[((?>[^\]]+))\]\]>/ ) {
 			$desc = $1;
@@ -3389,7 +3392,8 @@
 		my $service_type = $OSserv->getServiceCommonName($service_type_uri);
 
 		$result = $adaptor->query_authority({authority_id => $authority_id});
-		my $authURI = @$result[0]->{authority_uri};		 
+		my $row = shift(@$result);
+		my $authURI = $row->{authority_uri};		 
 		$output .=
 "\t<Service authURI='$authURI' serviceName='$servicename' lsid='$lsid'>\n";
 		$output .= "\t<serviceType>$service_type</serviceType>\n";




More information about the MOBY-guts mailing list