[MOBY-guts] biomoby commit

Eddie Kawas kawas at dev.open-bio.org
Tue Nov 25 17:29:55 UTC 2008


kawas
Tue Nov 25 12:29:54 EST 2008
Update of /home/repository/moby/moby-live/Perl/MOBY-Server/lib/MOBY/Client
In directory dev.open-bio.org:/tmp/cvs-serv15412/Perl/MOBY-Server/lib/MOBY/Client

Modified Files:
	MobyUnitTest.pm 
Log Message:
fixed the way that i was using the hash references.
moby-live/Perl/MOBY-Server/lib/MOBY/Client MobyUnitTest.pm,1.2,1.3
===================================================================
RCS file: /home/repository/moby/moby-live/Perl/MOBY-Server/lib/MOBY/Client/MobyUnitTest.pm,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- /home/repository/moby/moby-live/Perl/MOBY-Server/lib/MOBY/Client/MobyUnitTest.pm	2008/11/19 21:31:21	1.2
+++ /home/repository/moby/moby-live/Perl/MOBY-Server/lib/MOBY/Client/MobyUnitTest.pm	2008/11/25 17:29:54	1.3
@@ -195,15 +195,15 @@
 	# for each doc and remove from current level of hash
 	for my $key ( keys %$control ) {
 		next unless $key =~ m/^xmlns[:]?/;
-		$control_ns->{''} = %$control->{$key} if $key eq 'xmlns';
-		$control_ns->{$1} = %$control->{$key} if $key =~ m/xmlns\:(.*)$/g;
-		delete %$control->{$key};
+		$control_ns->{''} = ${$control}->{$key} if $key eq 'xmlns';
+		$control_ns->{$1} = ${$control}->{$key} if $key =~ m/xmlns\:(.*)$/g;
+		delete $$control->{$key};
 	}
 	for my $key ( keys %$test ) {
 		next unless $key =~ m/^xmlns[:]?/;
-		$test_ns->{''} = %$test->{$key} if $key eq 'xmlns';
-		$test_ns->{$1} = %$test->{$key} if $key =~ m/xmlns\:(.*)$/g;
-		delete %$test->{$key};
+		$test_ns->{''} = ${$test}->{$key} if $key eq 'xmlns';
+		$test_ns->{$1} = ${$test}->{$key} if $key =~ m/xmlns\:(.*)$/g;
+		delete ${$test}->{$key};
 	}
 
 	# compare current level number of keys
@@ -223,27 +223,27 @@
 			{
 
 				# are we dealing with scalar values now or more nesting?
-				if ( ref( %$control->{$key} ) eq 'ARRAY' ) {
+				if ( ref( ${$control}->{$key} ) eq 'ARRAY' ) {
 					# both items should be an array
-					next unless ref(%$test->{$test_key}) eq 'ARRAY';
+					next unless ref(${$test}->{$test_key}) eq 'ARRAY';
 					# array sizes should match here ...
-					next unless  @{%$control->{$key}} == @{%$test->{$test_key}};
+					next unless  @{${$control}->{$key}} == @{${$test}->{$test_key}};
 					# more nesting try matching child nodes
 					my $child_matches = 0;
-					foreach my $child ( @{ %$control->{$key} } ) {
+					foreach my $child ( @{ ${$control}->{$key} } ) {
 						my $matched = undef;
-						foreach my $test_child ( @{ %$test->{$test_key} } ) {
+						foreach my $test_child ( @{ ${$test}->{$test_key} } ) {
 							$matched = $self->_compare_current_level( $child, $test_child, $control_ns, $test_ns );
 							$child_matches++ if $matched;
 							last if $matched;
 						} # end inner foreach
-						$matching_nodes++ if @{ %$control->{$key} } == $child_matches;
+						$matching_nodes++ if @{ ${$control}->{$key} } == $child_matches;
 					} 
 				} else {
 					# compare scalar values now
 					# we dont care about whitespace, so we need to trim the text
-					my $c_text = $self->_clear_whitespace(%$control->{$key});
-					my $t_text = $self->_clear_whitespace(%$test->{$test_key});
+					my $c_text = $self->_clear_whitespace(${$control}->{$key});
+					my $t_text = $self->_clear_whitespace(${$test}->{$test_key});
 					$matching_nodes++ if $c_text eq $t_text;
 					last if $c_text eq $t_text;
 				}
@@ -332,6 +332,8 @@
 	croak "not yet implemented ...\n";
 }
 
+sub DESTROY { }
+
 1;
 
 __END__




More information about the MOBY-guts mailing list